Hi Watson, in your example you’re importing gql from “@apollo/client” and using it as a string template tag function. This works perfectly well.
The issue reported here is that if you follow the TypeScript example, the code generation for the schema generates a function that can’t be used as a tag. The guide in the Apollo docs suggests using the function as a function call with parenthesis. But this is not supported by the VSCode extension.
This is not helpful. What I believe the OP was requesting is to have both working side-by-side as they serve two separate functions. I suspect this is because your own docs say to stop using Apollo CLI for typescript generation. One allows development insight while coding Query/Mutations client-side such as auto-completion as well as profiling feedback inline in the doc (Apollo Extention), while the other provides the static typings (Graphql CodeGen) to be used in the Vue files or React files.
I also am looking for the best of both worlds so that I have auto-complete assistance while creating Query files separately from the Vue component. Then also having the types present in Vue files when using the request data as refs, computedRefs, etc etc. Can’t we get the best of both?
[2022-07-07] Are you here for codegen? We highly recommend using graphql-code-generator instead. Codegen in this repo is no longer supported and will be removed completely in a future version. For additional migration details, please see this fantastic writeup by @dotansimha: #2053