-
Notifications
You must be signed in to change notification settings - Fork 95
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
Support for multiple schemas (on multiple endpoints) #84
Comments
There's no support for this at the moment. I suggest you have two scripts that copy to graphql.confg.json which is watched by the plugin. |
I just hit this one as well, working on a storage backend that has multiple schemas. It would be very useful to pair the schema with the endpoint in some way. |
Has anyone tried merging with lodash or something else? I wrote this code but it doesn't merge as expected.
|
Would indeed be amazing to have, I have several endpoints, that i would love to have support for rather than having to update my config all the time when i change between them. |
I've already set to get the schema from an url endpoint. I don't know how to make the plugin to get a .graphql schema file for apollo link state's local store as well as from an url endpoint. |
The 2.0 alpha makes it possible to have multiple schemas in a single project using IntelliJ/WebStorm "Scopes". You can configure them for the project in the IDE Settings dialog. See 2.0.0-alpha-2 if you'd like to try it and help test it. |
I'll quickly outline how to set it up. The schemas are kept apart using the "Scopes" feature in your IDE: 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 how to configure multiple schemas with v2 of the plugin. |
Hi, I am unable to "link" 4 projects together properly.
Where
The "link" between I have looked at the
But Idea did not recognise that. Idea expects to have this file in |
@petr-ujezdsky You're on the right track with the projects-based configuration since your schemas span folders at the same levels in the file system. I'm not sure what you mean by the resources folder, but the graphql config needs to be in the same or a parent directory to anything that it matches in the The example at https://github.com/jimkyndemeyer/graphql-config-examples/blob/master/two-schemas-plus-shared-using-projects is pretty close to what you're trying to do. Maybe there's a clue there as to why your config isn't working. Edit: Take a look in the "File" > "Project structure" > "Modules" dialog of your project. The root directory that you place the config file in must be considered part of the project files to be picked up by the plugin (it uses the "Project files" search scope). |
For sometime I had it working like this and it would generate a core.schema and content.schema correctly, but after moving to the new format with .yml it doesn't work anymore.
This is the new grahpql.config.yml that doesn't work:
|
@Blindpupil Please log a new issue which includes the version of the plugin you're using. This is a very old thread for 1.x of the plugin. Thanks. |
I need to access two different graphql endpoints from a project, where each endpoint has a different schema.
I'm currently keeping two different copies of graphql.config.json that I swap between as needed.
Is there a better way to handle this? If not, consider this an enhancement request.
The text was updated successfully, but these errors were encountered: