Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown interface types in result list throws exception #6415

Open
1 task done
A360JMaxxgamer opened this issue Aug 4, 2023 · 1 comment · May be fixed by #6467
Open
1 task done

Unknown interface types in result list throws exception #6415

A360JMaxxgamer opened this issue Aug 4, 2023 · 1 comment · May be fixed by #6467
Labels

Comments

@A360JMaxxgamer
Copy link
Collaborator

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

@A360JMaxxgamer
Copy link
Collaborator Author

A360JMaxxgamer commented Aug 4, 2023

I would suggest instead of throwing a NotSupport exception, the deserialization returns null and only items which are not null are added to the list. If the solution is fine for you guys, I can fix it and submit a pr in the next days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant