I work on multiple GraphQL projects under the same IDE. When I switch between them, I keep seeing the same queries, which is extremely inconvenient and makes it hard to share the queries with the other team members.
In my case, scratch.graphql file is kept in ~/Library/Application Support/JetBrains/PhpStorm2021.3, which is shared across all my projects and not part of any or them.
I've looked into the documentation to check if we could configure the location of scratch.graphql in .graphqlconfig, so that we'd be able to move it into within the project and commit it then. Unfortunately, I haven't found any mention of that.
The ideal solution would be:
If we could configure the location of scratch.graphql file(s) in .graphqlconfig, it would be possible to have separate scratch.graphql files (each per project) and keep them within the projects, which would help achieve:
the queries are shared across the team members (via code versioning system, e.g. git)
the queries are coupled to the projects, so you can only see and work with the queries that make sense in the context of the project you're woking on
Disclamer
Probably, this is already possible and available, and I haven't just read the documentation well enough. if that's the case, please guide me to the right direction.
the only trick you'll need to do in addition is - update the first line of the scratch file. There should be something starting with # .graphqlconfig=... - just update it, it should contain a relative path your project root, not the absolute one
The problem:
I work on multiple GraphQL projects under the same IDE. When I switch between them, I keep seeing the same queries, which is extremely inconvenient and makes it hard to share the queries with the other team members.
In my case,
scratch.graphql
file is kept in~/Library/Application Support/JetBrains/PhpStorm2021.3
, which is shared across all my projects and not part of any or them.I've looked into the documentation to check if we could configure the location of
scratch.graphql
in.graphqlconfig
, so that we'd be able to move it into within the project and commit it then. Unfortunately, I haven't found any mention of that.The ideal solution would be:
If we could configure the location of
scratch.graphql
file(s) in.graphqlconfig
, it would be possible to have separatescratch.graphql
files (each per project) and keep them within the projects, which would help achieve:Disclamer
Probably, this is already possible and available, and I haven't just read the documentation well enough. if that's the case, please guide me to the right direction.
TIA