Skip to content

Latest commit

 

History

History
87 lines (51 loc) · 3.31 KB

graphql.md

File metadata and controls

87 lines (51 loc) · 3.31 KB

GraphQL Development

GraphQL developement requires number of tools and packages that can be used on both client and server. Our target will be to provide comprehensive set of the tools to add graphql support for both client and server side applications

Recommended Packages for Node.js Server development

Recomended packages for Client side development

Recomended practices for GraphQL Schema development

Guidance

When building GraphQL API from scratch we recomend using reference GraphQL-js reference implementation which was proven to be the most performant and have continous support from community. Entire development is currently backed by Linux foundation.

GraphQL Server

For GraphQL Server we recomend using GraphQL-Express for exposing GraphQL APIs over the network and GraphQL-Tools to build GraphQL Schema:

https://github.com/ardatan/graphql-tools#example

Developers can use top level database query languages. We recomend using Knex(http://knexjs.org/) for performing queries from GraphQL to relational databases.

If your GraphQL model have relationships please consider using DataLoader to prevent from overfetching problem:

https://github.com/graphql/dataloader

GraphQL Client

For GraphQL client we recomend URQL (https://formidable.com/open-source/urql/) that can work with React and any other JS based library. When using bundler we strongly recomend to compile your graphql queries using GraphQL-Tag:

https://github.com/apollographql/graphql-tag

Typescript support

If you use typescript in your project we recomend GraphQL-Code-Generator to generate typings for both client and server:

https://graphql-code-generator.com

Persisted queries

Persisted queries are mechanism to improve performance by utilizing already cached and well known queries. Those queries can be also later hosted on the CDN.

For persisted queries we can use approaches that are:

  • Dynamic (no need to compile queries on client as server caches them)
  • Static (requires client side compilation)

For static persited queries we recomend https://github.com/valu-digital/graphql-codegen-persisted-query-ids

For dynamic persisted queries we recomend

  1. Apollo APQs which needs Apollo server