Update API calls in your app

Many API client libraries that you might use to call the Shopify Admin API support both REST and GraphQL. However, you need to make updates to your code that uses these libraries. Some updates that you need to make might include the following:

  • Switching from a REST client to a GraphQL client
  • Changing the API endpoint
  • Updating the method
  • Adding your query or mutation and specifying the fields to return
  • Destructuring or digging into the response

You don't need to update your authentication or session handling to update from REST to GraphQL.

Use the following examples to understand the changes that you need to make for each API library.

This guide doesn't explain all of the changes that you need to make to your app to use GraphQL instead of REST. For example, you need to update your error handling and pagination logic. Learn more about considerations when migrating from REST to GraphQL.