Skip to content
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

[Bug] arguments for directives are lost when using nautilus #3

Open
sGy1980de opened this issue Apr 14, 2022 · 1 comment
Open

[Bug] arguments for directives are lost when using nautilus #3

sGy1980de opened this issue Apr 14, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sGy1980de
Copy link

The introspection and query planner is unaware about the arguments for directives. So with nautilus it's currently impossible to use the built-in directives like @include or @skip, since the query planner complains about the if argument being unknown. The introspection query clearly shows the problem.

Version affected: v0.1.19

Expected result:

{
  "directives": [
    {
      "name": "deprecated",
      "description": "Marks an element of a GraphQL schema as no longer supported.",
      "locations": [
        "FIELD_DEFINITION",
        "ENUM_VALUE"
      ],
      "args": [
        {
          "name": "reason",
          "description": "Explains why this element was deprecated, usually also including a suggestion\nfor how to access supported similar data. Formatted in\n[Markdown](https://daringfireball.net/projects/markdown/).",
          "type": {
            "kind": "SCALAR",
            "name": "String",
            "ofType": null
          },
          "defaultValue": "\"No longer supported\""
        }
      ]
    },
    {
      "name": "include",
      "description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
      "locations": [
        "FIELD",
        "FRAGMENT_SPREAD",
        "INLINE_FRAGMENT"
      ],
      "args": [
        {
          "name": "if",
          "description": "Included when true.",
          "type": {
            "kind": "NON_NULL",
            "name": null,
            "ofType": {
              "kind": "SCALAR",
              "name": "Boolean",
              "ofType": null
            }
          },
          "defaultValue": null
        }
      ]
    },
    {
      "name": "skip",
      "description": "Directs the executor to skip this field or fragment when the `if` argument is true.",
      "locations": [
        "FIELD",
        "FRAGMENT_SPREAD",
        "INLINE_FRAGMENT"
      ],
      "args": [
        {
          "name": "if",
          "description": "Skipped when true.",
          "type": {
            "kind": "NON_NULL",
            "name": null,
            "ofType": {
              "kind": "SCALAR",
              "name": "Boolean",
              "ofType": null
            }
          },
          "defaultValue": null
        }
      ]
    }
  ]
}

Current result:

{
  "directives": [
    {
      "args": [],
      "description": "Marks an element of a GraphQL schema as no longer supported.",
      "locations": [
        "FIELD_DEFINITION",
        "ENUM_VALUE"
      ],
      "name": "deprecated"
    },
    {
      "args": [],
      "description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
      "locations": [
        "FIELD",
        "FRAGMENT_SPREAD",
        "INLINE_FRAGMENT"
      ],
      "name": "include"
    },
    {
      "args": [],
      "description": "Directs the executor to skip this field or fragment when the `if` argument is true.",
      "locations": [
        "FIELD",
        "FRAGMENT_SPREAD",
        "INLINE_FRAGMENT"
      ],
      "name": "skip"
    }
  ]
}
@sGy1980de sGy1980de added the bug Something isn't working label Apr 14, 2022
@sGy1980de
Copy link
Author

This issue is reflected in upstream: nautilus#152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant