This post was originally published in adityasridhar.com
What is GraphQL?
It is basically a query language for API's
GraphQL shows what...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for the tutorial Aditya!
Question: When does the resolve for movies get executed for a directorType? Does it run the function every time you call for a director, or does this code run beforehand and is cached in case the user makes a call for a director's movies?
Thanks!
That's a really good question.
It would run every time you call for a director. And in a Real application that resolve function may end up calling a DB or making a HTTP request.
To make this more efficient a cache could be implemented so that the DB or HTTP call can be avoided whenever possible. But the cache implementation would be specific to your application.
@aditya Nice Tutorials. First time understand the graphql concepts clearly. Thanks.
In this tutorial you're testing the input/output by the Graphiql web UI.
How would I make the request from within the code, instead of the UI?
You could send a HTTP POST request to the graphql server. For example using curl you can call the hello endpoint as follows
You can checkout the following url to know more about accessing the graphql endpoints from a client.
graphql.org/graphql-js/graphql-cli...
I recommend learning with visual editor here:
graphqleditor.com/
Thanks for sharing this. Pretty helpful
Thanks alot for the tutorial!
It was a really nice introduction to GraphQL, great work.
Ooooh, great tuto Aditya!!!
Simple and direct. Now I'm ready to learn more about GraphQL.
Thanks.
Thank you. Glad it helped.