graphql-platform: Strawberry Shake error about already registered type

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When building any project with Strawberry Shake 12.2.2, the following error is displayed:

CSC : error SS0006: The name `Query` was already registered by another type.

Steps to reproduce

  1. Clone https://github.com/jorrit/strawberryshakebug2
  2. Run dotnet build

Relevant log output

PS C:\Projects\strawberryshakebug2> dotnet build
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
CSC : error SS0006: The name `Query` was already registered by another type. [C:\Projects\strawberryshakebug2\strawberryshakebug2.csproj]

Build FAILED.

CSC : error SS0006: The name `Query` was already registered by another type. [C:\Projects\strawberryshakebug2\strawberryshakebug2.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.27

Additional Context?

No response

Product

Strawberry Shake

Version

12.2.2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 22 (12 by maintainers)

Most upvoted comments

After submitting the issue I tried so change "documents": "**/*.graphql", to "documents": "Queries.graphql", and this worked. Apparently the following config:

"schema": "schema.graphql", "documents": "**/*.graphql",

causes schema.graphql to be loaded twice.

This seems weird to me, as the manual recommends this configuration.

@jfavrod have you watched the video? StrawberryShake.CodeGeneration.CSharp.Analyzers is gone in 13. The setup is now different.

@michaelstaib , the project I’m working in was setup using v12.x.x. I just want to be able to make changes to the project, but that effort is confounded by the ambiguity errors. If version 13 is ready, we can look at making changes to deploy the app with 13, but seeing that 13 is still in preview we’ve been holding on that and still releasing version 12. I don’t like the situation, and not sure what the best resolution is.