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

Override used schema in the GraphQL injection explicitly using a comment #485

Open howyp opened 3 years ago

howyp commented 3 years ago

Plugin is great, thanks!

I'm using the syntax-checking for code snippets in markdown files, such as:

```graphql
query {
  products {
    id
    description
    name
    notes { name value }
  }
}

It works really well, but I have multiple schemas that I'd like to be able to document in one file, and I wondered if there was a way to specify which schema to use in a given code block, rather like you can with a comment in a scratch file? ie. in a scratch file it seems you can do it with a special comment:

```graphql
# .graphqlconfig=/Users/example!Customer

query {
  products {
    id
    description
    name
    notes { name value }
  }
}

Thanks!

vepanimas commented 2 years ago

Hi! It's a good idea, but it's not so simple to implement correctly with the current plugin architecture. To be honest, I don't think we'll be working on this in the near future until the highest priority things are done, but I'll definitely think about it later.