ChilliCream / ChilliCream/graphql-platform

Strawberry Shake: Code generation fails when GraphQL field names conflict with System.Object method names

Open
#8,934 3 comments 3 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.11

Link to minimal reproduction

https://github.com/karlssberg/strawberry-shake-bug

Steps to reproduce
  1. Create a GraphQL schema with a type containing a field named equals:
type StringMatch {
  equals: String
}
  1. Generate Strawberry Shake client code
  2. 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., EqualsEqualsValue or Equals_)
  • 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.