graphiql: [graphql-lsp] Template string fragment get `Unknown fragment` error
When inserting a fragment inside a template string, the fragment does not get recognized when it gets called in the rest of the gql string

IDE: VSCode 1.75.1
Extensions:
- GraphQL: Language Feature Support
v0.8.5 - GraphQL: Syntax Highlighting
v1.0.6
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 4
- Comments: 15 (7 by maintainers)
I’m still having this issue:
fragment file:
.graphqlconfig:
Adding “documents” to my config file worked, thanks!
@VinceBT-BG music to my ears! another happy user. I will add something to the FAQ section for users using legacy
schemaPathawesome gif tool by the way, i like the keyboard icons, maybe I will use this!
I was indeed using
schemaPathinstead ofschemain the configuration! I tried on the example and it worked, I also tried in my project and I don’t have the errors anymore, thanks !EDIT:
Indeed when using
schemaPath, in order for the fragments to work, the files need to be specified in anincludesfield, whereas ifschemais present, it will work if placed indocumentsinstead.