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
880 stars 97 forks source link

Schema directives file cannot be read by the plugin #436

Closed canatufkansu closed 3 years ago

canatufkansu commented 3 years ago

Describe the bug When I create attached directives trough Lighthouse PHP package artisan command, JS Graphql add-on doesn't accept the file.

To Reproduce Link to Repo with Reproduction or Steps to Reproduce:

  1. Use this file to in the project -> schema-directives.txt
  2. Check schema.graphql -> schema.txt
  3. See that JS Graphql addon cannot check schema with given directives file.
  4. Change the contents of the schema-directives file this given content -> schema-directives.txt
  5. See that this time JS Graphql can check schema against given directives file.

Expected behavior When I create directives.graphql file through Lighthouse Php package JS Graphql should recognize the file and check my schema.graphql file according to it.

Screenshots If applicable, add screenshots to help explain your problem.

Version and Environment Details Operation system: Macos 11.2.2 IDE name and version: PhpStorm 2020.3 Plugin version: 2.9.0

Additional context I understand this issue is also related to Lighthouse Php package but I couldn't find any error on their directives file that is generated. Thus I open an issue on your side.

tzkmx commented 3 years ago

Same bug in Windows 10 with PhpStorm 2020.3.2, plugin version 2.9.0, downgrading plugin (tried 2.8 and 2.7) does not help, graphql files are not recognized anymore.

vepanimas commented 3 years ago

Hi @canatufkansu! I think it's because of repeatable directives (https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/issues/351), they are not supported yet, but I'm currently working on it. I'm going to finish a complete redesign of the schema building process within this month.

As a quick fix, you could remove "repeatable" from the directives and check if it starts working.

canatufkansu commented 3 years ago

Hi @canatufkansu! I think it's because of repeatable directives (#351), they are not supported yet, but I'm currently working on it. I'm going to finish a complete redesign of the schema building process within this month.

As a quick fix, you could remove "repeatable" from the directives and check if it starts working.

Hi, @vepanimas

I tried the quick fix, it solved most of the issues but there is still an error.

image

image

vepanimas commented 3 years ago

@canatufkansu hi! Sorry for the late response. The error message says that the type with the name _ is not defined, but it should be. I'm not sure what are you trying to achieve exactly, but you could try to define it manually like this

scalar _

# or

input _ {
    empty: String # input types must have at least one field
}

type Query {
    id(orderBy: _): String
}

Repeatable directives support will be available soon.