Skip to content

StrawberryShake.Tool Introspection Query Uses Deprecated Fields #9019

@ManasviiDesai

Description

@ManasviiDesai

Product

Strawberry Shake

Version

14.2.0

Link to minimal reproduction

Bug is produced in Client environment

Steps to reproduce

  1. Install StrawberryShake.Tool version 14.2.0 or 15.1.11
  2. Configure .graphqlrc.json with a GraphQL endpoint URL
  3. Run the command:
    dotnet graphql update --token <token> --scheme bearer
    OR
    dotnet graphql download --url <graphql-endpoint> --token <token> --scheme bearer
  4. The introspection query fails with the error above

What is expected?

The tool should use a modern introspection query that uses the locations field instead of the deprecated onOperation, onFragment, and onField fields, conforming to the June 2018 GraphQL specification.

What is actually happening?

The tool sends an introspection query that includes deprecated fields, which are rejected by GraphQL servers that conform to the current GraphQL specification.

Relevant log output

Download schema started.
error INTROSPECTION_ERROR: Cannot query field "onOperation" on type "__Directive".
Cannot query field "onFragment" on type "__Directive".
Cannot query field "onField" on type "__Directive".

Additional context

According to the GraphQL June 2018 Specification, the __Directive type should use:

  • locations: [__DirectiveLocation!]! (current)
  • Instead of: onOperation: Boolean!, onFragment: Boolean!, onField: Boolean! (deprecated)

The introspection query generated by StrawberryShake.Tool should be updated to use the locations field to be compatible with modern GraphQL servers.

  • StrawberryShake.Tool Version: 14.2.0, 15.1.11 (both tested)
  • StrawberryShake.Server NuGet Package: 14.2.0, 15.1.11 (both tested)
  • .NET Version: .NET 8.0
  • Operating System: Windows 10
  • GraphQL Server: Hot Chocolate: 14.2.0

.config/dotnet-tools.json

{
  "version": 1,
  "isRoot": true,
  "tools": {
    "strawberryshake.tools": {
      "version": "15.1.11",
      "commands": [
        "dotnet-graphql"
      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions