graphql-request
Version:
Minimal GraphQL client supporting Node and browsers for scripts or simple apps.
16 lines • 887 B
TypeScript
/**
* Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.
*
* @example
* ```
* import { gql } from 'graphql-request'
*
* await request('https://foo.bar/graphql', gql`...`)
* ```
*
* @remarks
*
* Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named "gql". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.
*/
export declare const gql: (chunks: TemplateStringsArray, ...variables: unknown[]) => string;
//# sourceMappingURL=gql.d.ts.map