ChilliCream / ChilliCream/graphql-platform

NodeResolver for interface types

Open
#5,414 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem?

I have an interface type with two implementing object types. Both object types refer to the same entity, so they share the same Id. This Id is also part of the aforementioned interface.
Other object types have properties referencing these Ids. Since a global Id must be unique for a type, these properties referencing the interface type can not point to a concrete implementation. They have to be serialized for the interface type. This works fine.

The problem is with object identification. I currently have no way to specify a node resolver for an interface type. So I can't fetch the interface type through the node(s) field.

The solution you'd like

The global object identification spec speaks of identifying objects, but it's never explicitly said that an object must be an object type.

I think the best solution would be to allow to define a node resolver for an interface type.

Product

Hot Chocolate

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 reading the NodeResolver implementation and the node(s) field handling for interface types. Trace how global object identification currently selects concrete object types, then determine what behavior is required for an interface-level resolver. Done means an interface node resolver can identify and fetch the shared entity through the node(s) field without breaking concrete type resolution.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.