You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraphQL is a query language for APIs that allows you to query specific data from an endpoint. Let's test it by creating a copy of our React app and modifying it to use GraphQL.
Copy your React app to another folder
We will only need the home page for this
Explore the GraphQL API
We are going to the a GraphQL version of the TMDB API. Click here to access the sandbox and click on the Docs tab to explore the queries and types
Setup the API in your new app
Let's use Apollo Client for that. Here is the documentation on how to add it to you app.
Use GraphQL to access the trending media
And that's it! By the end you should have a page that works just like the one you had using a REST API but this time you are using GraphQL and only requesting the data that you need, improving the performance of your app.
If you need some extra help understanding the syntax of GraphQL, here are some useful links:
GraphQL is a query language for APIs that allows you to query specific data from an endpoint. Let's test it by creating a copy of our React app and modifying it to use GraphQL.
We will only need the home page for this
We are going to the a GraphQL version of the TMDB API. Click here to access the sandbox and click on the Docs tab to explore the queries and types
Let's use Apollo Client for that. Here is the documentation on how to add it to you app.
And that's it! By the end you should have a page that works just like the one you had using a REST API but this time you are using GraphQL and only requesting the data that you need, improving the performance of your app.
If you need some extra help understanding the syntax of GraphQL, here are some useful links:
The text was updated successfully, but these errors were encountered: