-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support importing fragments #3
Comments
any news? |
@jvbianchi you can disable validation rules to suppress errors // .gqlconfig
{
match: "path/to/files",
validate: {
extends: "gql-rules-query",
rules: {
KnownFragmentNames: "off",
NoUnusedFragments: "off"
}
}
} |
@Mayank1791989 I done it. It solved the errors for me. Thanks |
I'm not sure that suppressing the errors is necessarily the best solution. One might want to know, for instance, about truly unknown or unused fragments, not just fragments from other files. graphql-language-service provides a good model for how I think it could work. All of the fragments glob'd from query.files.match have their fragments stored in a map of name to parsed fragment. This information is made available as needed for autocompletion, validation, etc of queries that may reference fragments specified in the same file or other files. Essentially, everything that gets glob'd is globally namespaced. No #imports required. |
@mgadda suppressing errors is only a temp solution for above import based graphql files as I dont want to implement #imports which is not part of graphql spec and very specific to javascript language client.
Yes It's already on the roadmap of next version to support relay-modern client and it will be something similar to that. |
Any update on this? |
Transferred from kumarharsh/graphql-for-vscode#22
Enhancement, see documentation in gql-tag.
@majodev - from what I read, this is a webpack feature rather than an editor feature. Can you clarify exactly what you mean?
Sure, this allows to import fragments from other files, however the plugin does not understand the import syntax, which leads to
NoUnusedFragments
andKnownFragmentNames
errors.See the attached screenshot.

OK, I understand, thanks for the screenshot too. I'll look into how to do this.
I think the gql repo will be the best place to handle this.
The text was updated successfully, but these errors were encountered: