Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding fragments array to graphql function disables syntax highlighting in VS Code #78

Closed
3 tasks done
DPangerl opened this issue Feb 25, 2024 · 2 comments
Closed
3 tasks done

Comments

@DPangerl
Copy link

Describe the bug

I have syntax highlighting and formatting for graphql enabled in VS Code. This works with gql.tada without problems. The contents of the graphql function are recognized as graphql and I get completion, suggenstions…

However, as soon as I add the fragment array as second argument, all language features are gone and it renders everything as simple template string.

So this is not recognized as graphql anymore

export const query = graphql(
  `
    query fetchCaseByTransactionPin($transactionPin: Int!) {
      case_byTransactionPin(transactionPin: $transactionPin) {
        id
        ...CaseByTransactionPin
      }
    }
  `,
  [caseByTransactionPinFragment]
);

I use the following extensions for VS Code:

  • Graphql: Syntax Highlighting
  • Graphql: Language Feature Support

Both from Graphql Foundation and I guess the most used extensions for gql. They do not provide any config to adjust detection, though. So I see no way to make this work.

Reproduction

No response

gql.tada version

v1.2.1

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct
@JoviDeCroock
Copy link
Member

This is being fixed in graphql/graphiql#3518

@kitten
Copy link
Member

kitten commented Feb 25, 2024

Also not a bug in the library itself so closing 😅

@kitten kitten closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants