ChilliCream / ChilliCream/graphql-platform

Allow extending interface types

Open
#7,757 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Type System
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Is your feature request related to a problem?

Related: #5974

Currently, HC allows extending all types implementing an interface, but not the interface itself.

Adding the ability to extend interfaces would greatly help domain-focused codebases where the domain types do not correspond exactly to the GraphQL types, and where one wants to keep the GraphQL layer as a separate layer on top of the domain layer. I do that in my codebases - I use explicit binding globally, and use type extensions to have full control over what goes in the GraphQL schema.

The solution you'd like

Allow extending interfaces just like we can now extend object types.

In #5974, it was mentioned that a type interceptor might be used, but I do not know how to accomplish this using a type interceptor. I just want to write a normal, friendly type extension class and have it apply to the interface itself.

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 by reviewing the existing object-type extension handling and the related discussion in #5974, then compare it with the type-interceptor approach mentioned here. The work is done when a normal type extension class can target an interface itself, with behavior consistent with existing object-type extensions and appropriate coverage in the project's tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, graphql
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.