UNPKG

@shopify/cli-kit

Version:

A set of utilities, interfaces, and models that are common across all the platform features

39 lines (38 loc) 2.18 kB
import { GraphQLVariables, GraphQLResponse, CacheOptions, UnauthorizedHandler } from './graphql.js'; import { RequestModeInput } from '../http.js'; import { Variables } from 'graphql-request'; import { TypedDocumentNode } from '@graphql-typed-document-node/core'; /** * Executes a GraphQL query against the Partners API. * * @param query - GraphQL query to execute. * @param token - Partners token. * @param variables - GraphQL variables to pass to the query. * @param cacheOptions - Cache options. * @param preferredBehaviour - Preferred behaviour for the request. * @param unauthorizedHandler - Optional handler for unauthorized requests. * @returns The response of the query of generic type <T>. */ export declare function partnersRequest<T>(query: string, token: string, variables?: GraphQLVariables, cacheOptions?: CacheOptions, preferredBehaviour?: RequestModeInput, unauthorizedHandler?: UnauthorizedHandler): Promise<T>; export declare const generateFetchAppLogUrl: (cursor?: string, filters?: { status?: string; source?: string; }) => Promise<string>; /** * Executes a GraphQL query against the Partners API. Uses typed documents. * * @param query - GraphQL query to execute. * @param token - Partners token. * @param variables - GraphQL variables to pass to the query. * @param preferredBehaviour - Preferred behaviour for the request. * @param unauthorizedHandler - Optional handler for unauthorized requests. * @returns The response of the query of generic type <TResult>. */ export declare function partnersRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables>, token: string, variables?: TVariables, preferredBehaviour?: RequestModeInput, unauthorizedHandler?: UnauthorizedHandler): Promise<TResult>; /** * Sets the next deprecation date from [GraphQL response extensions](https://www.apollographql.com/docs/resources/graphql-glossary/#extensions) * if `response.extensions.deprecations` objects contain a `supportedUntilDate` (ISO 8601-formatted string). * * @param response - The response of the query. */ export declare function handleDeprecations<T>(response: GraphQLResponse<T>): void;