ChilliCream / ChilliCream/graphql-platform

Deserialization of null values in the list

Open
#6,328 0 comments 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

In schema I have an object WinLine in schema with list line: [Int]!
image
image

According to the document https://spec.graphql.org/October2021/#sec-Combining-List-and-Non-Null the list may contain values [1, 2, null] but the StrawberryShake v12.17-13.3.1 client throws an exception error:
Unhandled exception. StrawberryShake.GraphQLClientException: The requested operation requires an element of type 'Number', but the target element is of type 'Null'.

Steps to reproduce
  1. add an object of type [Int]! to the GraphQL API request
  2. try to deserialise the request which contains a list object with values [0, null, 1, 2], for example
Relevant log output

No response

Additional Context?

No response

Version

13.3.1

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 v13.3.1 deserialization of a non-null list type [Int]! containing [0, null, 1, 2]. Trace the client deserialization path that raises the GraphQLClientException; done means the response is accepted and the null list element is preserved without an exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, graphql
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.