Member Junction
    Preparing search index...
    gql: (chunks: TemplateStringsArray, ...variables: unknown[]) => string

    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.

    Type Declaration

      • (chunks: TemplateStringsArray, ...variables: unknown[]): string
      • Parameters

        • chunks: TemplateStringsArray
        • ...variables: unknown[]

        Returns string

    import { gql } from 'graphql-request'

    await request('https://foo.bar/graphql', gql`...`)

    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.