Js-graphql-intellij-plugin: Allow having multiple configs in a project (scope per subfolder)

Created on 4 Apr 2018  路  5Comments  路  Source: jimkyndemeyer/js-graphql-intellij-plugin

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.

enhancement v2-alpha v2-architecture

All 5 comments

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.

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

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

advance512 picture advance512  路  5Comments

idkjs picture idkjs  路  3Comments

MaxmaxmaximusAWS picture MaxmaxmaximusAWS  路  4Comments

ryanquinn3 picture ryanquinn3  路  5Comments

CarsonF picture CarsonF  路  5Comments