Strawberry Shake 13 - Generating client when schema has JSON scalar causes error
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Product
Strawberry Shake
Describe the bug
Generating client when schema has JSON scalar causes error
After upgrading to version 13.0.4, I’m getting the following error…
Error GQL: An item with the same key has already been added. Key: JSON
31>_GenerateGraphQLCode: dotnet “C:\WINDOWS\ServiceProfiles\NetworkService.nuget\packages\strawberryshake.server\13.0.4\build..\tools\net6\dotnet-graphql.dll” generate “D:\agents\agent02_dev_pr_work\2\s\GrowFlow.ArcClient” -o “D:\agents_work\2\s\ArcClient\obj\Release\netstandard2.0\berry” -n GrowFlow.ArcClient -a md5 -t Generate C# Clients started. Generate ArcClient started. Generate ArcClient completed in 332 ms
I do have a JSON scalar type in my schema defined…
“The JSON
scalar type represents JSON values as specified by ECMA-404.”
scalar JSON
Removing the JSON scalar type from the schema fixes the build issue (edited)
Steps to reproduce
- Create new strawberry shake client
- Use the schema provided below
- Wire up SS client to schema
- Build project
- Get Error
schema { query: Query mutation: Mutation }
type ApiRequest{ nodeId: ID! id: Int! body: JSON }
“The JSON
scalar type represents JSON values as specified by ECMA-404.”
scalar JSON
Relevant log output
Error GQL: An item with the same key has already been added. Key: JSON
31>_GenerateGraphQLCode:
dotnet "C:\WINDOWS\ServiceProfiles\NetworkService\.nuget\packages\strawberryshake.server\13.0.4\build\..\tools\net6\dotnet-graphql.dll" generate "D:\agents\agent02_dev_pr\_work\2\s\GrowFlow.ArcClient" -o "D:\agents\_work\2\s\ArcClient\obj\Release\netstandard2.0\berry" -n GrowFlow.ArcClient -a md5 -t
Generate C# Clients started.
Generate ArcClient started.
Generate ArcClient completed in 332 ms
Additional Context?
No response
Version
13.0.4
Issue Analytics
- State:
- Created 7 months ago
- Comments:11
Top GitHub Comments
Hi, I think I found the root cause of this issue. I’m creating a PR soon
First time using this package and I thought this was just me the entire time.
Also having this exact same issue. Was able to Generate the demo with no issues but see this when I go to build:
1>EXEC : error GQL: An item with the same key has already been added. Key: JSON
Hopefully there is a fix soon, kinda stuck 😦