Skip to content

[Shopify] Uptake Admin GraphQL API to version 2026-07#9221

Open
onbuyuka wants to merge 6 commits into
mainfrom
bugs/625461-shopify-api-2026-07-uptake
Open

[Shopify] Uptake Admin GraphQL API to version 2026-07#9221
onbuyuka wants to merge 6 commits into
mainfrom
bugs/625461-shopify-api-2026-07-uptake

Conversation

@onbuyuka

@onbuyuka onbuyuka commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Uptakes the Shopify Admin GraphQL API from 2026-01 to 2026-07 (two hops: 2026-04 + 2026-07) and handles the one 2026-07 deprecation that would otherwise silently break merchants: market-driven shipping.

1. Version bump

  • Bumped the pinned API version in ShpfyCommunicationMgt.Codeunit.al (VersionTok) from 2026-01 to 2026-07, and updated the doc references.

A full review of the 2026-04 and 2026-07 Admin GraphQL / Webhook changelog entries (76 relevant entries) found no other required query changes: the largest breaking change - inventory compare-and-swap changeFromQuantity + mandatory @idempotent (required in 2026-04) - was already implemented during the 2026-01 uptake, and every other breaking change either does not touch the connector surface or was already handled.

2. Market-driven shipping reader (Shopify upgrade guide, readers Option B)

Shopify is deprecating the merchant-owned deliveryProfile(s) APIs for shops that move to market-driven shipping (rollout Oct 1 2026; all merchants by Jul 1 2027). For those shops the legacy deliveryProfiles query the connector uses to discover shipping-method names returns stale/incomplete data, silently breaking the Shpfy Shipment Method Mapping.

  • ShpfyShippingMethods now detects the model via ShopFeatures.marketDrivenShipping.
  • Market-driven shops: reads active shipping option names from markets -> delivery.shipping.optionDefinitions (inline fragments for the concrete option types).
  • Legacy shops: unchanged deliveryProfiles path.
  • The read_markets scope is already requested by the connector - no scope change needed.
  • Adds GetMarketShippingMethods / GetNextMarketShippingMethods resources, two Shpfy GraphQL Type enum values, and a test covering the market-driven path.

Validation

  • Shopify App project builds clean (0 errors) via AL.
  • The new test file compiles clean (per-file diagnostics 0 errors). The test-project full build hits a pre-existing, unrelated environmental symbol gap (MockAzureKeyVaultSecretProvider in the untouched ShpfyTestShopify.Codeunit.al); CI compiles the test project properly.

Fixes AB#625461

Bump the pinned Shopify Admin API version from 2026-01 to 2026-07
(two hops, 2026-04 + 2026-07) and update the doc references.

No query rewrites are required. The largest breaking change in the
window - the inventory compare-and-swap changeFromQuantity plus
mandatory @idempotent directive that became required in 2026-04 - was
already implemented during the 2026-01 uptake. Every other 2026-04 /
2026-07 breaking change either does not touch the connector GraphQL
surface or was already handled in a prior uptake.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@onbuyuka onbuyuka requested a review from a team July 8, 2026 11:26
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jul 8, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 6 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Style 1 1 0 1 0

Totals: 1 knowledge-backed · 0 agent findings.

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

onbuyuka and others added 3 commits July 8, 2026 13:46
… shipping

Shopify is deprecating the merchant-owned deliveryProfile(s) APIs for shops
that move to market-driven shipping (rollout Oct 2026, all merchants by
Jul 2027). For those shops the legacy deliveryProfiles query returns
stale/incomplete data, so shipping-method discovery silently breaks.

ShpfyShippingMethods now detects the model via ShopFeatures.marketDrivenShipping
and, when enabled, reads active shipping option names from
markets -> delivery.shipping.optionDefinitions (readers Option B of Shopify's
upgrade guide). Legacy shops keep using deliveryProfiles unchanged. The
read_markets scope is already requested by the connector.

Adds two GraphQL resources (GetMarketShippingMethods / GetNextMarketShippingMethods),
two GraphQLType enum values, and a test covering the market-driven path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DeliveryCarrierCalculatedOptionDefinition has no `name` field - its rates
are named by the carrier at checkout - so selecting `name` on that inline
fragment returned an `undefinedField` GraphQL error. Only the flat-rate,
value-based and weight-based option types expose `name`; carrier-calculated
nodes now yield an empty name and are skipped by the existing name check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The rate limiter reserves throttle budget from the `# cost` line before
sending. Shopify reports requestedQueryCost 74 for the markets
shipping-option query (markets first:25 x optionDefinitions first:50), so
the previous estimate of 40 under-reserved and could trigger throttling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/Apps/W1/Shopify/App/src/Shipping/Codeunits/ShpfyShippingMethods.Codeunit.al Outdated
onbuyuka and others added 2 commits July 8, 2026 14:09
Guard the markets pagination loop against a non-terminating case: if the
Markets API returns hasNextPage=true with an empty edges array, the cursor
was never advanced and the same query would be re-issued forever. Exit as
soon as edges is empty - there is no cursor to advance - which also
guarantees the cursor update always runs on an initialized node.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ts responses

The HttpClientHandler cannot read the request body, so use the standard
Library - Variable Storage queue to return responses in call order: the
feature-detection query first, then the markets query. The combined mock is
split into MarketDrivenShippingFeatureResponse.txt and
MarketShippingMethodsResponse.txt, and the test asserts the queue is drained.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/Apps/W1/Shopify/Test/Shipping/ShpfyShippingTest.Codeunit.al
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants