Agenda
What is GraphQL
GraphQL vs REST
Query, Mutation, Subscription
Fragments
Setting up GraphQL with Apollo
GraphQL is a query language for your API
GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data.
History
- Increased mobile usage creates need for efficient data loading
- Variety of different frontend frameworks and platforms on the client-side
- Fast development speed and expectation for rapid feature development
GraphQL lets you:
- Ask for what you need, get exactly that
-
Get many resources in a single request
-
Describe what’s possible with a type system
-
Evolve your API without versions
-
Bring your own data and code
-
Move faster with powerful developer tools


REST vs GraphQL

-
Describe data requirements
-
Display information in the UI
REST vs GraphQL
-
Construct and send HTTP request
-
Receive and parse server response
-
Store data locally
-
Display information in the UI
GraphQL(client)


While queries run in parallel, mutations run one after another

GraphQL(server)



Apollo
Useful links
- https://graphql.org/learn/
- https://www.howtographql.com/
- https://www.apollographql.com/docs/
- https://github.com/yuliaHope/rss-graphql-demo
Demo
GraphQL
By yuliaka71
GraphQL
- 69