Overview of Shopify's Admin GraphQL with Examples

An overview of GraphQL and how to use Shopify GraphQL with Shopify Flow

Rob Johnson

By Rob Johnson

Tue Mar 29 2022

#draft

If you're new to API's and want a quick overview, make sure to check out my previous post, Understand API's in less than 3 minutes . You ask a question to the API endpoint, you get a response. Need to ask a different question, and/or need a different response? Then you'll need to make a change to the API. At first this can be simple, but the more endpoints you create and the more versions you have to support, the trickier things get.

GraphQL has an answer to this problem.

GraphQL basics

The best way to describe GraphQL, is to compare it to alternative API query languages.

  1. SOAP APIs (Simple Object Access Protocol): An XML-based protocol that is good for transferring a lot of information at once.
  2. REST APIs (Representational State Transfer): A stateless protocol which doesn't require server-side sessions
  3. GraphQL (Graphical Query Language):

RESTful API’s are intended to give quick responses to GraphQL is an alternative technology that

https://shopify.dev/api/admin-graphql

A query language for your API GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

Ask for what you need, get exactly that Send a GraphQL query to your API and get exactly what you need, nothing more and nothing less. GraphQL queries always return predictable results. Apps using GraphQL are fast and stable because they control the data they get, not the server.

Get many resources in a single request GraphQL queries access not just the properties of one resource but also smoothly follow references between them. While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections.

Query roots, edges and nodes

https://shopify.dev/api/admin-graphql/2022-01/objects/queryroot#fields https://www.shopify.com/partners/blog/getting-started-with-graphql

Shopify's GraphiQL

Shopify has built in a tool that you can install on your own Shopify store https://shopify.dev/apps/tools/graphiql-admin-api

Making Shopify GraphQL Admin API calls in Postman

Why is Shopify moving to GraphQL?

Applying a hold on a fulfillmentOrder

GraphQL basics

The best way to describe GraphQL, is to compare it to alternative API query languages.

  1. SOAP APIs (Simple Object Access Protocol): An XML-based protocol that is good for transferring a lot of information at once.
  2. REST APIs (Representational State Transfer): A stateless protocol which doesn't require server-side sessions
  3. GraphQL (Graphical Query Language):

RESTful API’s are intended to give quick responses to GraphQL is an alternative technology that

https://shopify.dev/api/admin-graphql

A query language for your API GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

Ask for what you need, get exactly that Send a GraphQL query to your API and get exactly what you need, nothing more and nothing less. GraphQL queries always return predictable results. Apps using GraphQL are fast and stable because they control the data they get, not the server.

Get many resources in a single request GraphQL queries access not just the properties of one resource but also smoothly follow references between them. While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections.

Query roots, edges and nodes

https://shopify.dev/api/admin-graphql/2022-01/objects/queryroot#fields https://www.shopify.com/partners/blog/getting-started-with-graphql

Shopify's GraphiQL

Shopify has built in a tool that you can install on your own Shopify store https://shopify.dev/apps/tools/graphiql-admin-api

Making Shopify GraphQL Admin API calls in Postman

Why is Shopify moving to GraphQL?

Applying a hold on a fulfillmentOrder

# commerce 14 # seo 5 # tools 6 # amazon 1 # sql 4 # shopify 9 # javascript 13 # projects 4 # css 2 # git 2 # php 3 # analytics 4 # api 6 # monitoring 2 # python 2 # aws 2