GraphQL
Arnar Þór Sveinsson @arnarths
• Data defined as a cyclic graph instead of
endpoints.
• Mutations exposed as part of schema
• All data exposed through a single endpoint
Beyond REST
Benefits
• Fewer roundtrips to the server
• UI components can describe
their own data dependencies
• Typesafe client/server contract
Features
• Apollo client
• Works well with Redux
• Available for React, Angular, iOS, Android and standalone client
• Relay
• Developed by Facebook
• Lokka
• Raw client
Clients
• One entry point - /graphql
• Single schema with all of our data
• ClientAPI defines the schema and fetches the
data VIA thrift from other services
• Apollo client with Redux
How is WOW using GraphQL
• Client side caching
• Refetch prop
• Loading prop
• Force fetch attribute
• Components define their own data
• Becomes part of the Redux store we already have
defined
Apollo Client
• Apollo devtools
• React devtools (when using Relay)
• ESLint
• GraphiQL
• Auto complete my request plugin (wants)
Development tools
• Pagination - create
an interface for
pagination
• How to deal with
authorization?
• Error handling?
• Partial responses?
Best practices

Graphql

  • 1.
  • 2.
    • Data definedas a cyclic graph instead of endpoints. • Mutations exposed as part of schema • All data exposed through a single endpoint Beyond REST
  • 3.
    Benefits • Fewer roundtripsto the server • UI components can describe their own data dependencies • Typesafe client/server contract
  • 4.
  • 5.
    • Apollo client •Works well with Redux • Available for React, Angular, iOS, Android and standalone client • Relay • Developed by Facebook • Lokka • Raw client Clients
  • 6.
    • One entrypoint - /graphql • Single schema with all of our data • ClientAPI defines the schema and fetches the data VIA thrift from other services • Apollo client with Redux How is WOW using GraphQL
  • 7.
    • Client sidecaching • Refetch prop • Loading prop • Force fetch attribute • Components define their own data • Becomes part of the Redux store we already have defined Apollo Client
  • 8.
    • Apollo devtools •React devtools (when using Relay) • ESLint • GraphiQL • Auto complete my request plugin (wants) Development tools
  • 9.
    • Pagination -create an interface for pagination • How to deal with authorization? • Error handling? • Partial responses? Best practices