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 with gql 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 bar ApolloGraphQL button when in a file that matches the glob, a status message similar to below is displayed.
------------------------------
🚀 Apollo GraphQL v1.4.5
------------------------------
✅ Service Loaded!
🆔 Service ID: OSTK GraphQL Demo1
🏷 Schema Tag: current
📈 Number of Types: 45 (0 client types)
------------------------------
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 than apollo.config.js the error message below is shown in the OUTPUT panel.
------------------------------
🚀 Apollo GraphQL v1.4.5
------------------------------
❌ Service stats could not be loaded. This may be because you're missing an apollo.config.js file or it is misconfigured. For more information about configuring Apollo projects, see the guide here (https://bit.ly/2ByILPj).
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 was examples/) with a component the uses a gql tagged template literal. Try different includes config setting with and without ./ at the beginning to see the difference in behaviour
Versions
apollo@2.4.4
vscode@1.31.0
apollo-graphql@1.4.5
Auto-complete and type hints do not work in
gqltagged 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 withgqltagged 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 barApolloGraphQLbutton 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
ApolloGraphQLbutton when in a file other thanapollo.config.jsthe 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 agqltagged 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