-
Notifications
You must be signed in to change notification settings - Fork 219
POC of adding header support to app execute
#6716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
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. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3561 tests passing in 1415 suites. Report generated by 🧪jest coverage report action from 2fa99aa |
d3c6bcf to
b7caf67
Compare
942d105 to
3528546
Compare
3528546 to
a0e2060
Compare
a0e2060 to
2fa99aa
Compare
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 declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/api/admin.d.ts@@ -25,6 +25,10 @@ export interface AdminRequestOptions<TResult, TVariables extends Variables> {
responseOptions?: GraphQLResponseOptions<TResult>;
/** Custom request behaviour for retries and timeouts. */
preferredBehaviour?: RequestModeInput;
+ /** Custom HTTP headers to include with the request. */
+ addedHeaders?: {
+ [header: string]: string;
+ };
}
/**
* Executes a GraphQL query against the Admin API. Uses typed documents.
@@ -41,6 +45,14 @@ export declare function adminRequestDoc<TResult, TVariables extends Variables>(o
* @returns - An array of supported API versions.
*/
export declare function supportedApiVersions(session: AdminSession, preferredBehaviour?: RequestModeInput): Promise<string[]>;
+/**
+ * GraphQL query to retrieve all API versions.
+ *
+ * @param session - Shopify admin session including token and Store FQDN.
+ * @param preferredBehaviour - Custom request behaviour for retries and timeouts.
+ * @returns - An array of supported and unsupported API versions.
+ */
+export declare function fetchApiVersions(session: AdminSession, preferredBehaviour?: RequestModeInput): Promise<ApiVersion[]>;
/**
* Returns the Admin API URL for the given store and version.
*
@@ -50,6 +62,10 @@ export declare function supportedApiVersions(session: AdminSession, preferredBeh
* @returns - Admin API URL.
*/
export declare function adminUrl(store: string, version: string | undefined, session?: AdminSession): string;
+interface ApiVersion {
+ handle: string;
+ supported: boolean;
+}
/**
* Executes a REST request against the Admin API.
*
@@ -82,4 +98,5 @@ export interface RestResponse {
headers: {
[key: string]: string[];
};
-}
\ No newline at end of file
+}
+export {};
\ No newline at end of file
|

Add custom HTTP header support to GraphQL operations
WHY are these changes introduced?
This PR adds the ability to include custom HTTP headers when executing GraphQL operations via the CLI, which enables more advanced API usage scenarios.
WHAT is this pull request doing?
--headerflag to theapp executecommand that accepts custom HTTP headers in "Key: Value" formatHow to test your changes?
Run a GraphQL query with a custom header:
Use multiple headers:
Verify that response extensions appear in the output when present.
Measuring impact
How do we know this change was effective? Please choose one:
Checklist