Add the Business Platform GraphQL data-access layer for store info#7756
Open
amcaplan wants to merge 1 commit into
Open
Add the Business Platform GraphQL data-access layer for store info#7756amcaplan wants to merge 1 commit into
amcaplan wants to merge 1 commit into
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4 tasks
f60666b to
f36a34f
Compare
dmerand
approved these changes
Jun 8, 2026
f36a34f to
73fbe9b
Compare
505bb03 to
caa73ce
Compare
Wire up GraphQL codegen for the store package's two Business Platform schemas and add the typed queries the `store info` command needs: - graphql.config.ts: register the storeBusinessPlatformDestinations and storeBusinessPlatformOrganizations codegen projects - packages/store/project.json: graphql-codegen nx targets (generate → postfix → eslint-format) - bin/get-graphql-schemas.js + .gitignore: fetch and ignore the store copies of the destinations/organizations schemas - packages/store/package.json: @graphql-typed-document-node/core for the generated typed-document-node output - package.json: knip config for the store workspace — ignore the generated files and the @graphql-typed-document-node/core dep (only type-imported by generated code), matching app/organizations/cli-kit - queries (destinations, owning-org, shop) and their generated types This is the typed client layer only; the services and command that consume it land separately. No user-facing surface on its own. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
73fbe9b to
6b71f98
Compare
caa73ce to
a7adece
Compare
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationspackages/cli-kit/dist/public/common/gid.d.ts/**
* Extracts the trailing numeric id from a plain GraphQL global id like
* `gid://shopify/Product/123`.
*
* @param gid - A plain GraphQL global id string.
* @returns The trailing numeric id, or undefined when the string does not end with `/<digits>`.
*/
export declare function numericIdFromGid(gid: string): string | undefined;
/**
* Decodes a base64-encoded GraphQL global id (for example, the form
* Business Platform APIs return) and returns the trailing numeric id.
*
* @param gid - A base64-encoded GraphQL global id.
* @returns The trailing numeric id, or undefined when the decoded string does not end with `/<digits>`.
*/
export declare function numericIdFromEncodedGid(gid: string): string | undefined;
/**
* Encodes a plain GraphQL global id (`gid://...`) as base64, which is the
* form some Business Platform endpoints require.
*
* @param gid - A plain GraphQL global id string to encode.
* @returns The base64-encoded gid.
*/
export declare function encodeGid(gid: string): string;
Existing type declarationspackages/cli-kit/dist/public/common/url.d.ts@@ -12,4 +12,20 @@ export declare function isValidURL(url: string): boolean;
* @param url - The string to parse into a URL.
* @returns A URL object if the parsing is successful, undefined otherwise.
*/
-export declare function safeParseURL(url: string): URL | undefined;
\ No newline at end of file
+export declare function safeParseURL(url: string): URL | undefined;
+/**
+ * Extracts the lowercased hostname from a URL-shaped string. Tolerates
+ * bare hosts (without a scheme) and inputs that come back from APIs as
+ * either or .
+ *
+ * @param value - A URL or bare host string, possibly null/undefined.
+ * @returns The lowercased hostname, or undefined when the input is empty.
+ */
+export declare function extractHost(value: string | null | undefined): string | undefined;
+/**
+ * Extracts the subdomain handle from a URL or host.
+ *
+ * @param value - A URL or host string, possibly null/undefined.
+ * @returns The myshopify subdomain handle, or undefined when the input isn't a URL.
+ */
+export declare function extractMyshopifyHandle(value: string | null | undefined): string | undefined;
\ No newline at end of file
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
store inforeads store metadata from two Business Platform schemas (Destinations + Organizations). This PR adds the typed GraphQL data-access layer for that — codegen wiring plus the queries and their generated types — separately from the service/command logic that consumes it (#7660). Splitting it keeps the feature PR focused on behavior, and lets the typed-client layer be reviewed on its own (these queries fetch exactly these fields).WHAT is this pull request doing?
graphql.config.ts— registersstoreBusinessPlatformDestinationsandstoreBusinessPlatformOrganizationscodegen projects.packages/store/project.json—graphql-codegennx targets (generate → postfix → eslint-format), mirroring the other packages.bin/get-graphql-schemas.js+.gitignore— fetch and ignore the store copies of the BP destinations/organizations schemas.packages/store/package.json(+@graphql-typed-document-node/core) and the lockfile entry.package.json— knip config for the store workspace: ignore the generated files and the@graphql-typed-document-node/coredep (only ever type-imported by generated code, so knip can't see it as used), matching the permanent blocksapp/organizations/cli-kitalready carry.store-info-destinations,store-info-owning-org(BP Destinations),store-info-shop(BP Organizations) — and their generated*.ts+types.d.ts.Nothing imports the generated documents yet (the services land in #7660), so there's no user-facing surface and no changeset. The generated output is reproducible:
nx graphql-codegen storeregenerates it byte-for-byte;knippasses (the block above covers the not-yet-consumed artifacts).How to test your changes?
bin/get-graphql-schemas.jsto fetch schemas, thenpnpm nx graphql-codegen store --skip-nx-cache— regenerates the committedgenerated/*.tswith zero diff.pnpm nx run-many --target=type-check,build --projects=store— the generated layer compiles.Checklist
sed -i ""postfix matches the repo's existing macOS-oriented targets