Skip to content

refactor(shopify): hardcode Admin API version (OAuth-only config) - #543

Merged
guitavano merged 1 commit into
mainfrom
guitavano/hardcode-api-oauth
Aug 19, 2026
Merged

refactor(shopify): hardcode Admin API version (OAuth-only config)#543
guitavano merged 1 commit into
mainfrom
guitavano/hardcode-api-oauth

Conversation

@guitavano

@guitavano guitavano commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What

The Shopify connection form is already OAuth-only — StateSchema was reduced to z.object({}) in #526, so there's no fillable domain/token/version field anymore (token comes from the OAuth Authorization header).

This PR removes the last piece of runtime-variable config: the Admin API version is now hardcoded to DEFAULT_API_VERSION (2026-07) instead of being resolved from state.apiVersion or the SHOPIFY_API_VERSION env var.

Changes

  • server/types/env.ts — drop apiVersion from ShopifyCredentials; update comment.
  • server/lib/client.ts — remove the state.apiVersion || SHOPIFY_API_VERSION || … resolution and the apiVersion field on MeshRequestContext.state / resolved creds; buildGraphqlUrl uses DEFAULT_API_VERSION directly.
  • server/lib/client.test.ts — drop the apiVersion cases/assertions.

Notes

  • Kept the local-dev env fallbacks (SHOPIFY_STORE_DOMAIN / SHOPIFY_ACCESS_TOKEN) and the legacy raw-token path — these aren't part of the connection schema and don't appear in the UI.
  • All 58 tests pass.

🤖 Generated with Claude Code


Summary by cubic

Hardcodes the Shopify Admin API version to DEFAULT_API_VERSION (2026-07) for the OAuth-only connection. Previously the version could be set via connection state or the SHOPIFY_API_VERSION env var; overrides are no longer supported to reduce config surface and prevent version drift.

  • Remove any use of apiVersion in ShopifyCredentials, MeshRequestContext.state, and downstream consumers; the GraphQL URL builder always uses DEFAULT_API_VERSION.
  • Stop setting SHOPIFY_API_VERSION; it has no effect.
  • No changes to the UI or OAuth flow; local dev fallbacks (SHOPIFY_STORE_DOMAIN, SHOPIFY_ACCESS_TOKEN) remain.

Written for commit 33ea311. Summary will update on new commits.

Review in cubic

The connection form is already OAuth-only (empty StateSchema). Remove the
last bit of user/deploy-facing config: the Admin API version is now fixed
to DEFAULT_API_VERSION instead of being resolved from state.apiVersion or
the SHOPIFY_API_VERSION env var.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@guitavano
guitavano merged commit 1a7b608 into main Aug 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant