
REST API's are very popular still today. So why would you start using GraphQL instead?
In this video we'll explore the big differences between GraphQL and REST. I'll also talk about why GraphQL is a better choice and how much more efficient it is.
GraphQL is all about using fields to get specific data out of your API. They are very flexible and always behave the same way, wherever you use them in your queries.
Sometimes you want to pass some information to your fields. With arguments you can do exactly that. You can for instance request the details of a blog post and give the ID of the post as an argument.
In this video I'll introduce two new concepts: aliases and fragments.
In GraphQL, every field that your query has to be unique. With aliases you can work around this limitation. So you can ask for details about blog post #1 and blog post #2 at the same time.
If you are querying the same fields over and over again, your queries become big and cluttered. With fragments you can group those repetitive fields and re-use them easily. Cleaner code & easier to manage!
When building an API you will definitely need to send some user input to the server. In GraphQL it's considered a bad practice to include user input into your query. Instead you can use variables to safely send user input to the server.
Up until this point I've talked a lot about how queries work in GraphQL. In this video we'll go over the differences between queries & mutations. They look a lot like each other, they behave in the same way and yet they are different.
GraphQL is a query language developed by Facebook to power their mobile applications. It's a replacement for traditional REST API's and is far more flexible and faster. With GraphQL you can query multiple resources with a single request to the server. Making it ideal for web applications and mobile apps.
It's very easy to write your own GraphQL API. It's compatible with any database and can even work across different database engines if required. Start now and have your GraphQL API running in no time!