Need help with configuring GraphQL VSCode extension for monorepo #2367
-
Hi! I'm a bit stuck and also a bit confused with how to set up the extension properly. So if anyone could help this would be highly appreciated! SetupI have a monorepo with roughly the following structure
This is my
The Problem(s)I've got mot of it more or less working but I'm struggling with the following things. First off all, I do not understand how projects are supposed to work. How does the extension know which "project" is meant? For example, how does the extension know that with
I mean the project 1. Schema extensionsI've tried to add the file
2. The scripts folderI always get the error
The funny thing here is, that I still get all type definitions for eg. mutations in my script files. So I assume that somehow the 3. The schema definitionThis is the bit which might be not working at all but I could live with the status quo. As mentioned, all my types and interfaces which define my client schema are in Currently, it works with the downside that click to definition leads me to the definition in the schema file rather that to the definition within my I know this is quite a lengthy question but I really hope someone could get me at least some hints to push me in the right direction! I'm struggling with this since nearly a month! Thanks! 🙌 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If someone is also struggling with this - I think a had a profound misunderstanding of how GraphQL config works! The following projects:
default:
schema:
- ./schema/client/schema.graphql
- ./schema/extensions/*.graphql
- ./schema/relay/relayDirectives.graphql
documents:
- ./frontend/**/*.{ts,tsx}
scripts:
schema:
- ./schema/admin/schema.graphql
source:
schema:
- ./schema/graphQl/source/**/*.graphql I still don't understand projects, so if someone can help - very much appreciated. |
Beta Was this translation helpful? Give feedback.
If someone is also struggling with this - I think a had a profound misunderstanding of how GraphQL config works!
The following
.graphqlrc
solved the problem for me (the goToDefinition in my GraphQL files still redirects me to the client schema file but this is something I can live with)I still don't understand projects, so if someone can help - very much apprec…