ChilliCream / ChilliCream/graphql-platform

Unknown interface types in result list throws exception

Open
#6,415 1 comment 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

Is there an existing issue for this?
  • I have searched the existing issues
Product

Strawberry Shake

Describe the bug

Use case:
Let's say I have some kind of following schema.

type Query { 
  getItems: [Item]
}

type A {}

type B {}

type C {}

union Item = A | B | C

C was later reduced to my schema and my blazor app with my strawberry shake client was not yet updated. The client still operates on the schema.

type Query { 
  getItems: [Item]
}

type A {}

type B {}

union Item = A | B

Error:

After my gateway or service is updated with type C my client in the app is broken. It fails on deserializing the received data.
Even though it only has fragments for the known types A and B.

Expectation:
The app ignores the unknown type and operates normally.

In my scenario various services broke even though they don't care about the new types.

Steps to reproduce
  1. Create strawberry shake client which queries for a list of a union type
  2. Return a json with an item which is not part of the union type of the generated client schema
  3. The client cannot deserialize the items
Relevant log output

No response

Additional Context?

My main issue is, that I cannot dynamically enhance my platform without updating my strawberry shake clients if each fails of unknown types.

Version

13.3.0

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 reproducing the Strawberry Shake client scenario from the listed steps: query a union list, then return JSON containing an unknown type. Trace the deserialization failure and verify that the client ignores unknown union members and continues processing known items without throwing.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.