Skip to content

Commit

Permalink
Merge pull request #1465 from Shopify/Support-storefront-api-access-f…
Browse files Browse the repository at this point in the history
…or-customer-account-standard-api

Support storefront api for customer account api
  • Loading branch information
brianshen1990 authored Oct 27, 2023
2 parents 355e19f + c3aaf8a commit 03d69b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ export interface Docs_Standard_StorageApi

export interface Docs_Standard_UIApi extends Pick<StandardApi<any>, 'ui'> {}

export interface Docs_OrderStatus_QueryApi
extends Pick<OrderStatusApi<any>, 'query'> {}
export interface Docs_Standard_QueryApi
extends Pick<StandardApi<any>, 'query'> {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
Storage,
Language,
AuthenticatedAccount,
GraphQLError,
StorefrontApiVersion,
} from '../shared';

import type {ExtensionTarget} from '../../targets';
Expand Down Expand Up @@ -83,6 +85,16 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
};
};
navigation: StandardExtensionNavigation;

/**
* Used to query the Storefront GraphQL API with a prefetched token.
*
* See [storefront api access examples](https://shopify.dev/docs/api/customer-account-ui-extensions/apis/standard-api/storefront-api#examples) for more information.
*/
query: <Data = unknown, Variables = {[key: string]: unknown}>(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
}

export interface CompanyLocationApi {
Expand Down

0 comments on commit 03d69b5

Please sign in to comment.