Our GraphQL Experience

Chris Grice
Mar 26, 2018 · 9 min read
Image for post
Image for post
Photo by Raphael Koh on Unsplash

What is GraphQL?

A query language for APIs

query {
products {
name
price
related { # We can descend into nested objects
name
price
}
inStockAt(storeId: 50) # We can provide inputs to fields
}
stores {
id
postcode
storeName: name # Aliasing too!
}
}
Image for post
Image for post
GraphiQL provides traversable documentation for your API, powered by introspection queries.

Describe your data as a graph

Image for post
Image for post
Schemas are written in SDL, which was added to the GraphQL specification in 2018.

A runtime for fulfilling API queries

An example of resolvers in GraphQL.js

Our Experience

Schema-first Development

Image for post
Image for post
This is how our board looks pretty much every sprint. Notice the big SCHEMA tasks!

Decoupled Teams

Image for post
Image for post
An example of how quickly you can mock out an API with graphql-faker.

Flexibility


Not a silver bullet


Build things faster and better

Sainsbury’s Tech Engineering

A dive into some of the engineering work done behind the…

Thanks to Luciano Visentin

Chris Grice

Written by

Engineering @ Sainsbury’s

Sainsbury’s Tech Engineering

A dive into some of the engineering work done behind the scenes at Sainsbury’s Tech. Interested in working with us? Check out open roles at sainsburys.jobs.

Chris Grice

Written by

Engineering @ Sainsbury’s

Sainsbury’s Tech Engineering

A dive into some of the engineering work done behind the scenes at Sainsbury’s Tech. Interested in working with us? Check out open roles at sainsburys.jobs.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store