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

Some directives are not included in the generated GraphQL Schema #592

Open jmfayard opened 2 years ago

jmfayard commented 2 years ago

Describe the bug Some directives are not included in the generated GraphQL Schema

To Reproduce

  1. Go to https://github.com/ExpediaGroup/graphql-kotlin/pull/1350
  2. Run the ./gradlew :ktor-server:run
  3. Fetch the GraphQL schema using js-graphql-intellij-plugin

Expected behavior

"This GraphQL directive allows to add constraints to the GraphQL Schema - https://www.apollographql.com/blog/backend/validation/graphql-validation-using-directives/"
directive @constraint(format: String!, maxLength: Int!, minLength: Int!, pattern: String!) on VARIABLE_DEFINITION | FIELD_DEFINITION | INPUT_OBJECT

input DirectiveInput {
    deviceId: String! @constraint(minLength: 8, maxLength: 16)
    email: String! @constraint(format: "email")
}

Actual behavior

With the graphql-kotlin library, I get the constraints inside the generated schema.

With js-graphql-intellij-plugin I don't get them

"This GraphQL directive allows to add constraints to the GraphQL Schema - https://www.apollographql.com/blog/backend/validation/graphql-validation-using-directives/"
directive @constraint(format: String!, maxLength: Int!, minLength: Int!, pattern: String!) on VARIABLE_DEFINITION | FIELD_DEFINITION | INPUT_OBJECT

input DirectiveInput {
    deviceId: String!
    email: String!
}

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

Version and Environment Details Operation system: MacOS latest IDE name and version: IntelliJ IDEA 2021.3.1 Plugin version: 3.1.2

Additional context

See https://github.com/ExpediaGroup/graphql-kotlin/pull/1350

jmfayard commented 2 years ago

Seems like the directives are not part of the introspection... https://github.com/graphql/graphql-spec/issues/300