graphql-codegen-vscode icon indicating copy to clipboard operation
graphql-codegen-vscode copied to clipboard

Doesn't work for exported tagged template literal `gql`

Open uloco opened this issue 4 years ago • 0 comments

I cannot make this work for files that create the graphql query with the gql tagged template literal and export them. It works with files that are just the query/mutation definition, but I want to export it with typescript and use it like so:

import { gql } from "graphql-request";

export const RegisterMutation = gql`
  mutation Mutation($profile: ProfileInput!) {
    register(profile: $profile) {
      ok
    }
  }
`;

I tried the following configuration

  "graphql-codegen.fileExtensionsDeclaringGraphQLDocuments": [
    "graphql",
    "gql",
    "ts"
  ],
  "graphql-codegen.filePathToWatch": "app/gql"

uloco avatar Nov 30 '21 12:11 uloco