UNPKG

@graphql-mesh/compose-cli

Version:
59 lines (58 loc) 1.92 kB
import { GraphQLSchema } from 'graphql'; import { LoaderContext } from './types'; export interface GraphQLSubgraphLoaderHTTPConfiguration { /** * A url or file path to your remote GraphQL endpoint. * If you provide a path to a code file(js or ts), * other options will be ignored and the schema exported from the file will be used directly. */ endpoint: string; /** * HTTP method used for GraphQL operations (Allowed values: GET, POST) */ method?: 'GET' | 'POST'; /** * Use HTTP GET for Query operations */ useGETForQueries?: boolean; /** * JSON object representing the Headers to add to the runtime of the API calls only for operation during runtime */ operationHeaders?: { [k: string]: any; }; /** * Request Credentials if your environment supports it. * [See more](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials) * * @default "same-origin" (Allowed values: omit, include) */ credentials?: 'omit' | 'include'; /** * Retry attempts if fails */ retry?: number; /** * Timeout in milliseconds */ timeout?: number; /** * Path to the introspection * You can separately give schema introspection or SDL */ source?: string; /** * JSON object representing the Headers to add to the runtime of the API calls only for schema introspection */ schemaHeaders?: any; /** * Subgraph spec * * @default false */ spec?: 'federation' | 'stitching' | 'fusion' | false; } export declare function loadGraphQLHTTPSubgraph(subgraphName: string, { endpoint, method, useGETForQueries, operationHeaders, credentials, retry, timeout, source, schemaHeaders, spec, }: GraphQLSubgraphLoaderHTTPConfiguration): (ctx: LoaderContext) => { name: string; schema$: Promise<GraphQLSchema>; };