ChilliCream / ChilliCream/graphql-platform

StrawberryShake.Tool Introspection Query Uses Deprecated Fields

Open
#9,019 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ strawberry shake
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

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"
      ]
    }
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at StrawberryShake.Tool's implementation of the dotnet graphql update and download commands and trace the introspection query they send. Verify that the query uses locations instead of onOperation, onFragment, and onField, then run the commands against a conforming GraphQL endpoint and confirm schema download or update succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, graphql
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.