Django and Graphql

Video in TIB AV-Portal: Django and Graphql

Formal Metadata

Django and Graphql
Title of Series
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this license.
Release Date

Content Metadata

Subject Area
Django and Graphql [EuroPython 2017 - Talk - 2017-07-11 - Anfiteatro 1] [Rimini, Italy] The web is constantly evolving, that is even more true with the frontend world. You don’t have anymore the traditional webapp, in fact you now have two apps, backend and frontend. But how do they communicate? Traditionally we have always created REST APIs, but now, there’s a new player. GraphQL
Intel Word Multiplication sign Software Projective plane Client (computing) Line (geometry)
Web 2.0 Internetworking Projective plane Expression Computer font
Web page Point (geometry) Email Server (computing) Multiplication sign Computer-generated imagery Data recovery Client (computing) Parameter (computer programming) Special unitary group Food energy Metadata Formal language Web 2.0 Medical imaging Latent heat Causality Term (mathematics) Operator (mathematics) Descriptive statistics Physical system Pay television Email Software developer Electronic mailing list Interactive television Client (computing) Representational state transfer Cartesian coordinate system Evolute Avatar (2009 film) Degree (graph theory) Type theory Category of being Personal digital assistant Telecommunication Website Physical system
Execution unit Pay television Open source Multiplication sign Execution unit Set (mathematics) Field (computer science) Parameter (computer programming) Field (computer science) Revision control Personal digital assistant Military operation Query language
Graph (mathematics) Military operation String (computer science) Query language Selectivity (electronic) Library (computing)
Context awareness Functional (mathematics) Computer virus Installation art Personal digital assistant Query language Social class Information Extension (kinesiology) Field (computer science) Social class
Computer file Numbering scheme
Context awareness Meta element Functional (mathematics) View (database) View (database) Multiplication sign Diffuser (automotive) Electronic mailing list Twitter Uniform resource locator Data model Type theory Personal digital assistant Object (grammar) Query language Social class Information Object (grammar) Endliche Modelltheorie Website
Meta element INTEGRAL Multiplication sign View (database) Common Intermediate Language Execution unit Source code 1 (number) Parameter (computer programming) Client (computing) Mereology Web 2.0 Data model Facebook Object (grammar) Single-precision floating-point format Query language Software framework Information security Boss Corporation Email Block (periodic table) Software developer Bit Front and back ends Degree (graph theory) Category of being Phase transition Software framework Website Right angle Information security Web page Slide rule Server (computing) Connectivity (graph theory) Authentication Disintegration Electronic mailing list Field (computer science) Number 2 (number) Twitter Product (business) Energy level Software testing Data structure Authentication Context awareness Addition Field (computer science) Limit (category theory) Cartesian coordinate system Sphere Cache (computing) Query language Personal digital assistant Speech synthesis Library (computing)
Point (geometry) Open source Adaptive behavior Parameter (computer programming) Mereology Event horizon Food energy Metadata Field (computer science) Query language Conservation law Software framework Software testing Physical system Raw image format Execution unit Graph (mathematics) Projective plane Diffuser (automotive) Field (computer science) Cartesian coordinate system Affine space Degree (graph theory) Personal digital assistant Logic Right angle Quicksort
Identity management
Email Type theory Pay television Uniform resource locator Error message Personal digital assistant Token ring output Login Message passing Row (database)
Email Meta element Type theory Error message Token ring output Login Information Object (grammar) Mereology Message passing Summierbarkeit
Meta element Adaptive behavior Token ring Dispersion (chemistry) Information
I want to know what ultimate so that when my time project and you can find me line that it but at 91 almost everywhere and the words that we're budgets is just ghosting serious we do website for clients and also yeah that
some Internet brought projects we may
use jungle primarily depends on what we are building so we change the font just by up to last yet we tried to use new technology as soon as possible because it's it's good to keep that up to speed with the new stuff that's going on on the Web expression deformed so them on the Web as a there
would be put developers we have seen the evolution of the web so from static website to website it's more interaction to website completely interactive and 1 of the best practice is to use REST API for the communication between the client and server and but yet they're arrested get good but sometimes you need something that's uh that's better and then it because there are some issues 1 of the most common too many cause so for example imagine that you have guy that gets used in energy you get something like this which is fine for example if you only need to see the should easily in the way the need for example the defense names in each local 404 old below the use of and this is as you can imagine not good especially for the for the user experience of your application whatsoever so 1 solution is to create an endpoint to the user with friends which we return to to the user with the friends and so on but then at the University of active for the use of data than other endpoints blasts another page just need the username in the image and you have to say if another 1 and so on and so forth uh and then this is only 1 case but imagine if you have many endpoints is going to get really but so 1 another another solution like work on that you can do is to have on everything that you can get from from that resource recovery down to the user with the French and the other thing about the new you're sending to much data your wrist and is not against knowledge that's been for the end user because you our wasting their time and money actually especially in terms of foreign countries so it's intimacy and people the 1 solution is laughter and difficulties of the language it but is he around 2012 but this funny made of consumers like 2 years ago around 2015 and they say in the specification that Kafka is assigned to be the kind of cation by providing an intuitive flexible syntax and system and so on this is really complicated for me that I never read the old and the specification that because there was so the example which is something like this this is if predator-prey language where you can specify from the client when you actually for example in this case that you are asking me to get the user name email and this defense and then you get when you do that the school you get something like this so you only get where you actually and it's really it's really easy to use but 1 of the most about the power for future and yes of so 1 of the most like features so everything Afghanistan so this year schemas can I have typed for example for we the US and user type just got the name the name that's things and always does the from the Commission mark and then you have a list of friends and friends another time which is have property naming human as well and then another fisheries introspection so this flea everything that just content point is punished um expose some metadata so you can get with the types for example in this
case we can use graphical which is an idea in Boston so you to compete your API and the arguments and the fears of examples giving the probability to name description and is getting the picture we size fly on the inside um so when I'm showing you degree which is this the way to get data from week after but also you need to change the the back in the for example that we receive the IC to was suppressed watch request so deletes so we got and you always use 1 single and on 1 single such which the repetition these costs and to change this I use mutation which is a way to take it on the server and then your 7 other operation Duchess of different which is the nephew 2 degree when you subscribe to the updates which is using usually use WebSockets so a priest on this it's like this as showed you have some
fields and your so you can have also some arguments so for example in this case is gonna get
human we made the 1 thousand names guide the unit of the puts but this is
only a short time for the green the actual
and the extended version of the of the approach the liberation is this 1 so this this this this you died as a set of mutation and a subscription and maybe
in the future can can they can extend these petitions and then you have an person name which is basically used mainly for the binding so you can logs and several without and yes process some very weird efficient reach for the tightly defined and then you have selection of the when you run honestly you get the diversity of possible but yet this is not for the conference so you want to use this Python to this
we find them you just use different caffeine which is a library that implements the graph to at 7 uh so you solid and then you can just important is the important medium the library to create a
class of pre in this case and creating a class just got money 1 field which is a little and then for each field you create our function which is called the sold the school to fit and you can determine what the field is gone up from a certain kind of so you can use the arguments and do some magic stuff and then you can create a schema from the green and again you can execute the queen but yet still gets me about jungle and
there's an extension to your finger which is caffeine jungle which is seen method if you buy it's got some uh some nice features for jungle reduces to to use it you so like this and then you have
to know how to extend this further upstream of graphene jungle and then you have to create coming scheme of which is needs to be specified in the I'm a convention is to use their full the
EPI in the schema file and size of 1 B B the schema which is being imported from all the other petitions and then you have to log d
trend that you found this case I'm adding a graphical view on the desk you answer stuff and and also time enabling the graphical site and about the API without doing any good and then use like this
you if you have a need a model you can just importance and you can create a ingredient types jungle object type that's provide the jungle and it's gonna create for diffuse for you so you don't have to do any of some functions you can still do it if you need to do some custom stuff but this
stuff for you if you don't need change and then you can create a query where you have to specify the um the and this is something a bit tricky because since you can 2 nested fields with uh graphene unit to be careful that you're not doing and cross 1 priest because uh it's not it's gonna be will but on the performance of so you can you can check the fuse on needed and you tend to select medieval Prefecture if needed and then it gets from the pre so uh 1 of the prominent only had a work is still evident addition on the and basically since that we are using down when it's really easy to do authentication golf planets this is a surge of of you know my view so you can use any method you like for example we you are using J. did everything that depends where you can also use session so that's if you don't have a single webpage application field when you see tough tries to announce some part of the website and yeah you can use the any was um then you have the permission this is our different on thing so for the permissions you basically saying you didn't really have missions modestly you have permission the bonding lecture fees and and which is I think it's really good because you can say for example if I'm not as a super use I can see the use of e-mail and the final doesn't understand the user can only see the username but if you for example need to an integration with less famous uh for example you really have an API uh this is something that is not working right now and I made up for request that you can have a look at it if you want and you can also use and using 1 of 1 of the present work because any many some use cases the test and then see if there's any parts this you Don means to uh do you can you can use caffeine jungle with our generous arises so you don't have to specify the this utilizes again for especially for limitations the um here then I would like to touch in a bit of security just um since you can't do that are nested spheres some malicious users can do like decrease so for example they can as they can act like 1 on this level of nesting is so 1 of the solution I think it's been adopted by the tub and she's using a trend production and also it's public I suggest limit the number next thing that you can have and for example if the nesting level is more than 10 take just of the query because it's probably something that's a bit strange and also you have long queries because there since you can also specify arguments you maybe you can end up in a query that's gonna take too much time and I think Facebook is doing something like this this could they have a time of in-degree 1 degrees gonna take more than 1 and just off the green and nothing reach the thing is what we should do this uh 1 seconds related to what's question it so this is the a 2nd part for the front and the said and this is you can see use and then you find that you like to post requests to the web server but and there are 2 main libraries the you
can use danger the we of categories 1 is really a really which is on your right and the it's a library developed by phase with but it's it's it's only 3 actually fuse reactors is probably 1 of 4 the best solution because it's for the but these were the only promise that the developments that this that led by Facebook so that day in many they to stuff on the but it's really good and then the other solution is so full of which is they think it's community-based and busy they have clients will for running adjusted if you don't use any framework they'll serve clients for the yes uh react uh think cosine grant some 1 and it I think I was really fast and so so and so kinetochore the on the content block and the last slide 1st basically uh and we just so you can do them just some of the fish them until about structure and some of those for example fragments so you can have like some components start to add depends on how the data so you can basically you can only do 1 Create including the components and then you get everything we just concrete example if you have an about speech and then you get for example the user name and in 1 place and for example you have to use the funds in the page you can combine the phrase from those components and it's gonna go anyone cream and or so I was 1 of the issues that Cushing since the since you're going down post suppressor cannot cost you cannot use something like financial a pure jungle fashion um because yielding positive quest for this so 1 of the solution that's being implemented by both phase really and up police to use client-side caching so Apple is really good at this when you don't really is gonna cost of the source for you so if you did that we again have been up on this and it's not just random these and other solutions could be to use that and uh to analyze the in the degree that you're doing and impressions on those ones but it's a bit harder than than just few recursively eyes because said you just think of the boss calls and produces coming from because that jealous when you about like a lot of a lot of their companies are using in production like facebook of course and should be fine and you cover the main ones and they're really pushing it to the limits and there also contributing to display which is you sum so yeah that's my talk
if any any questions please feel free to do it and then again without yeah at the yeah yeah thank yeah think about agreed on so my 1st question is how we view with the which nations using graphical sorry the but if how the only question is how do we know which nations are yet the east of 1 of the ways using uh this is the day has come up in a sort of pagination system so as I said you can specify the the arguments and agree that and
so in this case for example and to find deeper you can also specify for example the start and the end and I think so yeah relating something it's it's using the like edges so this instead of returning the deletion of the user in this case return artist events so you can get the ideas and the get suffered in the energy maybe if each of them and introduce some example because with a with this the part to that thank you and my 2nd question is why using a generalized framework or some kind of arrestable polje but you can really easy to specify which end point is Bullock which is going to supply the gas can can you do this graph kill conservative on 1 and point and you can specify that is the only candidate is not out when the answer is yes I but I do not to do it because I mean have to do it I thought I was a which sold on graph can vary if it's have basically they're doing something like this uh but they have to waste to that is as first one use since they have the the PAC public and they can also uh for example you can we do application can look at a specific user they have permissions they checked before the amending Decree checked diffuse you asking for and detective this week field affinities can be accessed by the current user then but there and degree otherwise the useful in our and the other 1 is the schema the schemas publishing so basically when you do you exposed like something that I'm not going to create on the schema to adaptation and test on metadata on the on something is of basically this the quality to squeeze the DC this only for internal use so when a downloads test it out there so they can just to the field but when I'm using as a public use of them is not shown right thank you any more questions so I think you I said that a lot of companies it graph already for general graph graphene you take any open source project of the reference to see the problem solving and or would you recommend any open-source project that at certain just as below starting with graphene and no old is that would you recommend some hopeful logic of activities within the is the worst possible CPI which she was standing in Python and with them I think and there is the same for graph can so you can just go through this WAP API Europe has WPA Kafka and you start with a cake of that's 1 of those right we had 1 more would you mention the mutations that do you have any example we talk about how these mutations and guns with the work that I am an example and just use
also with the ion spacing
the created it
it it have to memorize it I it's a permanent but that that sensationalist please specify the but depression named than the name of the mutation which this is from service and and then specify some inputs in this case have an input which is good good and then this is the type of answer set them using just a with the and and 1 of the reason why I the deeper records for the locations for some uh for graphene junglist because I wanted to use these deserializer which does everything from me and yes a sedimentation seen that creates they can yet yet
past input cost then you can get data you can specify delivery 1 but but I do want to see the jungle part of this and thank you thank you yes it is
actually it's similar to the 1 used and jungle object type from graphene Tonga so use reason sterilize
imitation in dispersive place because of plus then is going to be a team adaptation for you and I'm just something to consider to just because I for it anymore presence it would be walls and