Shopify names its Admin API versions by year and month: 2024-01, 2024-04, 2024-07 and so on. Your app picks one in each client it creates. Nothing stops working on the day a version leaves support, which is the problem: the responses quietly start coming from a newer version.
Requests fall forward
When a request names an unsupported version, Shopify answers with the oldest version it still supports. If that version removed or reshaped a field your app reads, the change reaches production without a deploy. The fix is to upgrade on your own schedule, which means knowing every place your code pins a version.
Find every version pin
An app often creates more than one client: a GraphQL client for newer features, a REST client for older code, and a Python script somewhere else. Each can pin a different version. gitgo usages lists every Shopify client, the version each one pins, and each call it makes. This is its output on five small files:
$ gitgo usages ./app
graphql.ts:4:16 shopify client_init createAdminApiClient
graphql.ts:4:86 shopify version_pin 2024-04
graphql.ts:5:17 shopify client_init shopifyApi
graphql.ts:8:26 shopify call request
graphql.ts:13:19 shopify client_init shopify.clients.Graphql
graphql.ts:14:10 shopify call query
graphql_execute.py:5:5 shopify call GraphQL.execute
graphql_execute.py:6:12 shopify call GraphQL.execute
products.py:3:11 shopify client_init Session
products.py:3:49 shopify version_pin 2024-01
products.py:4:1 shopify client_init ShopifyResource.activate_session
products.py:8:12 shopify call Product.find GET /admin/api/{api_version}/products.json
products.py:12:12 shopify call Product.find GET /admin/api/{api_version}/products/{id}.json
products.py:16:12 shopify call Order.find GET /admin/api/{api_version}/orders.json
remix_graphql.ts:3:17 shopify client_init shopifyApp
remix_graphql.ts:12:22 shopify call admin.graphql
remix_graphql.ts:13:21 shopify call admin.graphql
rest.ts:3:17 shopify client_init shopifyApi
rest.ts:6:18 shopify client_init shopify.clients.Rest
rest.ts:6:66 shopify version_pin 2024-01
rest.ts:7:22 shopify call get GET /admin/api/{api_version}/products.json
rest.ts:8:9 shopify call put PUT /admin/api/{api_version}/products/{id}.json
22 API usages in 5 files; 5 files scanned, 0 skippedThree of the five files pin a version: two pin 2024-01 and one pins 2024-04. REST calls show the endpoint they hit. GraphQL calls from @shopify/admin-api-client, @shopify/shopify-api, @shopify/shopify-app-remix and the Python GraphQL class are listed too.
Check the REST changes between two versions
For REST, gitgo scan takes two OpenAPI descriptions of the Admin API and lists each line the change affects, as it does for Stripe. Shopify marked its REST Admin API as legacy in October 2024 and asks new public apps to use GraphQL. gitgo scan and gitgo diff also take two versions of the GraphQL Admin schema, as SDL or introspection JSON.
An upgrade checklist
- Run
gitgo usagesand note everyversion_pin. - Pick one target version for all clients.
- For REST calls, run
gitgo scanwith the OpenAPI descriptions of the current and target versions, and fix each breaking line. - For GraphQL calls, run
gitgo scanwith the current and target Admin schemas, then read Shopify's release notes for behaviour the schema does not show. - Change every pin to the target version in one pull request, so no client is left behind.