I’ve managed to get a good setup with TS code generation based on .graphql query files. But I’ve been wondering if it’s somehow possible to get autocompletion and validation of the queries in these .graphql files when writing them?
I’ve looked into using the introspection query to generate a schema.graphql to then use with a Graphql vs-code extension but it doesn’t seem that simple.
Anyone have any clues as to how to approach this? It feels a bit clunky to have to write all queries in the CDA Playground and then copy paste into vs-code.
With our demo project at least, I was able to get this working using one of the extensions: GraphQL for VSCode. There are several of them but this one seems to work:
All I had to do with install the extension, edit /graphql.config.yml with my CDA read-only API token, and then close and reopen the project (important).
Hi and thanks for the reply! I actually managed to get it working later after posting this, in more or less the way you suggested. So for anyone who stumbles upon this, do like above!
This might be something that would be neat to have documented, since this raises the devX quite a bit?