ChilliCream / ChilliCream/graphql-platform
StrawberryShake.Tool Introspection Query Uses Deprecated Fields
Nobody has claimed this yet.
- 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
- Install
StrawberryShake.Toolversion 14.2.0 or 15.1.11 - Configure
.graphqlrc.jsonwith a GraphQL endpoint URL - Run the command:
ORdotnet graphql update --token <token> --scheme bearerdotnet graphql download --url <graphql-endpoint> --token <token> --scheme bearer - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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