Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Up And Running With GraphQL

Up And Running With GraphQL

A hands-on introduction to GraphQL.

By Phillip Kigenyi - Software Engineer (Sellio) at Developer Circle Kampala

Developer Circle Kampala

June 16, 2018
Tweet

More Decks by Developer Circle Kampala

Other Decks in Programming

Transcript

  1. Flow What is Graphql Why Graphql Graphql vs REST Graphql

    concepts Demo Useful Links Q & A http://bit.ly/gqslides http://bit.ly/gqproject
  2. What is Graphql • 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 • Declarative data fetching. The query is shaped just like the data it returns • Single endpoint. Multiple queries • GraphQL APIs are organized in terms of types and fields, not endpoints
  3. Why Graphql • Get all app data in single request

    • Reduce over fetching and under fetching • Send a GraphQL query to your API and get exactly what you need • Evolve your API without versions • Self documenting. Introspection tool • Efficient data loading and usage
  4. • GraphQL Schema Definition Language. Define the schema of an

    API. Contract between the client and server Graphql concepts
  5. Graphql concepts • Introspection. Clients and tools query the type

    system. Self documenting • __Schema, __Type, __TypeKind, __Field, __InputValue, __EnumValue, __Directive - These all are preceded with a double underscore,
  6. Graphql concepts • Hierarchical. The query is shaped just like

    the data it returns • Strong-typing. Syntactically correct and valid within the GraphQL type system before execution • Types. ◦ Default scalar types. Float, Boolean, Float, Int ◦ User defined types. Enums, Interfaces, Union types ◦ Root types. Query, Mutation and subscription. By default exists on the root • Query. Client‐specified queries, client defines how result should appear • Mutations. Creating, Updating and deleting • Subscriptions. Connect to the server and wait for response. Similar to webhooks
  7. Useful Links • https://graphql.org • https://www.howtographql.com • https://www.howtographql.com/graphql-python/0-introduction/ • https://dev-blog.apollodata.com/the-basics-of-graphql-in-5-links-9e1dc4cac055

    • https://reactjs.org/blog/2015/05/01/graphql-introduction.html • https://github.com/howtographql/graphql-python • https://www.youtube.com/watch?v=BG1H6IrNbAk • https://www.youtube.com/watch?v=HebnYlIaK_0