ChilliCream / ChilliCream/graphql-platform

HC0065 error when multiple schema files contain overlapping type definitions

Open
#9,837 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

15.1.16

Link to minimal reproduction

https://github.com/andreashellquist/strawberryshake-hc0065-repro

Steps to reproduce

Clone the repo
Run dotnet build in src/StrawberryShakeHC0065/
Build fails with HC0065
The project has two schema files (schema-part1.graphql and schema-part2.graphql) that both define input PageLinkComponentUpsertInput. This simulates CMS schemas (Hygraph/Contentful) where the CLI exports overlapping types across multiple files.

What is expected?

When multiple schema files contain identical type definitions, the code generator should deduplicate them and succeed. This is the standard scenario when working with CMS-exported schemas.

What is actually happening?

Build fails with:
error HC0065: The name PageLinkComponentUpsertInput was already registered by another type.

HotChocolate.SchemaException: For more details look at the Errors property.

  1. The name PageLinkComponentUpsertInput was already registered by another type.
    (HotChocolate.Types.InputObjectType)
Relevant log output
src/StrawberryShakeHC0065/StrawberryShakeHC0065.csproj : error HC0065: The name `PageLinkComponentUpsertInput` was already registered by another type.
Additional context
  • Root cause: SchemaHelper.Load calls builder.AddDocument(document) independently for each non-extension schema file. When files have overlapping type definitions, the HotChocolate type system registers the same type name twice.
  • Workaround: Manually consolidate all types into a single .graphql file (impractical for large CMS schemas with hundreds of types).
  • Affected versions: 14.x (confirmed on 14.4.0)
  • The issue also affects files containing both extension nodes and regular type definitions — regular types get silently dropped.

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

Clone the linked reproduction and run dotnet build in src/StrawberryShakeHC0065/ to observe HC0065. Then inspect SchemaHelper.Load, especially how builder.AddDocument(document) handles non-extension schema files, overlapping definitions, and files mixing extensions with regular types. Done means the reproduction builds successfully and regular type definitions are not dropped.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.