@shopify/cli-kit
Version:
A set of utilities, interfaces, and models that are common across all the platform features
28 lines (27 loc) • 1.12 kB
TypeScript
import { UnauthorizedHandler } from './graphql.js';
import { RequestOptions } from './app-management.js';
import { Variables } from 'graphql-request';
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
/**
* @param query - GraphQL query to execute.
* @param shopFqdn - The shop fqdn.
* @param token - Partners token.
* @param variables - GraphQL variables to pass to the query.
* @param unauthorizedHandler - Unauthorized handler to use.
*/
export interface AppDevRequestOptions<TResult, TVariables extends Variables> {
query: TypedDocumentNode<TResult, TVariables>;
shopFqdn: string;
token: string;
unauthorizedHandler: UnauthorizedHandler;
variables?: TVariables;
requestOptions?: RequestOptions;
}
/**
* Executes an org-scoped GraphQL query against the App Management API.
* Uses typed documents.
*
* @param options - The options for the request.
* @returns The response of the query of generic type <T>.
*/
export declare function appDevRequestDoc<TResult, TVariables extends Variables>(options: AppDevRequestOptions<TResult, TVariables>): Promise<TResult>;