JetBrains / js-graphql-intellij-plugin

GraphQL language support for WebStorm, IntelliJ IDEA and other IDEs based on the IntelliJ Platform.
https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/
MIT License
879 stars 97 forks source link

Question: How to keep scratch.graphql scoped to the project (and share it) #598

Closed pioneer32 closed 2 years ago

pioneer32 commented 2 years ago

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 separate scratch.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

pioneer32 commented 2 years ago

I've found how it can be achieved: