ChilliCream / ChilliCream/graphql-platform
Strawberry Shake: Code generation fails when GraphQL field names conflict with System.Object method names
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
15.1.11
Link to minimal reproduction
https://github.com/karlssberg/strawberry-shake-bug
Steps to reproduce
- Create a GraphQL schema with a type containing a field named
equals:
type StringMatch {
equals: String
}
- Generate Strawberry Shake client code
- Attempt to build the project
What is expected?
The code generator should detect C# reserved method names and either:
- Automatically suffix the property name (e.g.,
Equals→EqualsValueorEquals_) - Provide a configuration option to customize property naming
- Change source generation to use explicit interface implementations to avoid member name clashes
What is actually happening?
Generated code creates a property named Equals which conflicts with System.Object.Equals(object), causing compilation errors:
error CS0102: The type 'StringMatch' already contains a definition for 'Equals'
Additional context
Also affects input declarations that contain fields matching System.Object method names.
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 with the minimal reproduction linked in the issue and generate the client code for the StringMatch type and the affected input declaration. Inspect the generated members and the Strawberry Shake code-generation entry points that produce them. Done means the generated project builds when GraphQL fields match System.Object method names, without breaking ordinary field generation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, graphql
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100