Giant Machines developers recently attended Apollo Day NYC to learn how GraphQL is being used in specific scenarios at several other companies. For the uninitiated, GraphQL is a way for clients and servers to communicate to query and manipulate data that offers a few key advantages.
Giant Machines has used GraphQL on several projects already, and Apollo is a major provider of open source GraphQL tooling, so our engineers were excited to learn what the Apollo team had to say.
Here are the big takeaways our engineers came back talking about:
We spend a lot of time writing data-fetching code. The GraphQL Apollo client and server can simplify this code and increase performance by easily caching data. That translates into faster, cheaper, better dev projects for Giant Machines clients. You don’t usually get all those three qualities at once.
Apollo aims to replace schema stitching with Apollo Federation, a gateway that will allow different services to extend and share parts of the same larger data graph. This can happen when you have a microservice architecture and you need to use multiple GraphQL services together. Schema stitching allowed you to use multiple underlying GraphQL APIs to create a single GraphQL schema. But this could get pretty involved, making it too easy for schemas to get out of sync, and resulting in a bad developer experience on larger teams.
Apollo has continued to improve the developer experience by providing CLI tooling to automatically generate TypeScript types based on a GraphQL schema; this can be used in conjunction with React to build/iterate on products more quickly.
yarn run apollo codegen:generate — localSchemaFile=graphql-schema.json — target=typescript — includes=src/**/*.ts — tagName=gql — addTypename — globalTypesFile=src/types/graphql-global-types.ts types
Credit to Faraz Amiruddin for the code snippet.
The Apollo team reported that they’re starting to see people using React-Apollo-Typescript in the wild (which we in the Giant Machines offices have affectionately dubbed “the RATstack”) so this new tooling will allow developers to speed up their developer process.
The Skinny
Obviously Apollo was there to talk about their product, but even when you account for the bias, what they had on offer was pretty impressive.
And they’re clearly keeping up with the times. We’re using React, TypeScript, and GraphQL very frequently, and the Apollo team is busily integrating these technologies tightly together and making their interoperability even smoother.
Giant Machines is already using GraphQL on yet another project, and we expect to see many more, so big thanks to the Apollo team for contributing to the dev community!