Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow having multiple configs in a project (scope per subfolder) #145

Closed
BerndWessels opened this issue Apr 4, 2018 · 5 comments
Closed
Labels

Comments

@BerndWessels
Copy link

Hi
I usually have a single webstorm open and a root folder that contains multiple different but related projects.
Therefore I have for example an user graphql endpoint in one sub folder and an admin graphql endpoint in another sub folder. Each of these has there very own graphql schema.

It would be great if the plugin would look into each subfolder for the graphql.config.json and graphql.schema.json and keep it in that subfolder scope.

So basically I don't want the plugin to force me to open multiple webstorms to work on multiple graphql endpoints with different schemas.

@jimkyndemeyer
Copy link
Collaborator

The 2.0 alpha release introduces support for multiple schemas using Intellij/WebStorm "Scopes".

See 2.0.0-alpha-2 if you'd like to try it and help test it.

@BerndWessels
Copy link
Author

@jimkyndemeyer Is there a documentation for how to configure multiple schemas in alpha 2?

@jimkyndemeyer
Copy link
Collaborator

No doc yet. But I'll quickly outline how to set it up.

The schemas are kept apart using the "Scopes" feature in your IDE:

image

For this example, I've added a single scope, and clicked the "src" folder, followed by "Include recursively".

As you work with GraphQL in the editor, the file you're in will be matched against the scopes, and the first match limits which schema type definitions etc. that are included.

Hope that clears things up.

I plan on creating a GraphQL-specific dialog for scopes such that users are free to use these generic scopes for other use cases.

@jimkyndemeyer
Copy link
Collaborator

@jimkyndemeyer
Copy link
Collaborator

See https://github.com/jimkyndemeyer/graphql-config-examples for examples of multi-schema configurations with v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants