ChilliCream / ChilliCream/graphql-platform

Strawberry Shake: fails to map properties when nested object is the same type on subscription. (EntityID null crash)

Open
#8,290 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

Product

Strawberry Shake

Version

15.1.3

Link to minimal reproduction
Steps to reproduce

It look very similar to this
https://github.com/ChilliCream/graphql-platform/issues/5256
But this issues is open since 2022 so my guest is that is was maybee not fixed for sub or something that slip through the crack.
So the problem need to meet those criteria

  • The nested object type must be the same as the parent (although it doesn't have to be the immediate child)
  • The parent object must contain an id field.
    So example If I have a query with this
contact{
    id,
    firstName
    marketingContact{
        isSubscribe
        contact_id
    }
}

and if I use the same for subscription, it will work if the marketingContact is NOT null.
But if my subscription return a null on the MarketingContact, it crash.
Theres a error on the Json parse on the EntityID (the id that strawberryshake auto generate)

For now I use the Graphql.net package for the subscription and it's working, so it's really related to the autogenerated code in SS.

Let me know if you need more information.
It's pretty hard to give a Repo since it's all linked with the DB, but if you really need one let me know and Ill see what I can do.
Thanks

What is expected?

Not to crash

What is actually happening?

It crash

Relevant log output

Additional context

No response

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

No files, tests, or entry points are named. Start by reproducing a Strawberry Shake subscription with a nullable nested object of the same type and inspect the generated code around EntityID JSON parsing; done means the subscription handles a null nested object without crashing.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.