-
Notifications
You must be signed in to change notification settings - Fork 467
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
[apollo-graphql] vscode gql tag functionality broken when relative globs used in includes config #1002
Comments
My suggestion for an improved version of the includesFile method that is consistent in treating the two relative globs the same is:
Basically, it's relying on |
I was using the code in this gist (running on node 8) to investigate what's going on. |
This is excellent, thank you for opening this issue and giving some background 🙌 |
Auto-complete and type hints do not work in
gql
tagged template literals when the includes config setting in apollo.config.js file has relative globs in it (globs that start with./
). Some of this is documented in issue #690.Intended outcome:
When I set my includes glob to
includes: ['./examples/**/*.{ts,tsx}'],
I expect that project files withgql
tagged template literals that match that glob work with apollo-graphql extension auto-complete and type hint hover functionality in the graphql query. And when clicking the status barApolloGraphQL
button when in a file that matches the glob, a status message similar to below is displayed.Actual outcome:
apollo-graphql extension functionality doesn't work in vscode. There are no type hints or auto-complete based on schema. Moreover, when clicking the status bar
ApolloGraphQL
button when in a file other thanapollo.config.js
the error message below is shown in the OUTPUT panel.Changing the includes config to
includes: ['examples/**/*.{ts,tsx}'],
(relative but without./
at the beginning) makes it work as expected.How to reproduce the issue:
Open an apollo-graphql based project that has client.service.localSchemaFile, client.service.url, or apollo engine set up and working properly. Set up a folder outside of the
src/
folder (this should skirt the default includes - in my case it wasexamples/
) with a component the uses agql
tagged template literal. Try different includes config setting with and without./
at the beginning to see the difference in behaviourVersions
apollo@2.4.4
vscode@1.31.0
apollo-graphql@1.4.5
The text was updated successfully, but these errors were encountered: