Why is the data not optional in ExecutionResult? #134
-
According to the description found in http://spec.graphql.org/October2021/#sec-Response-Format, the data will be null. Therefore, if the data is null, the data.decode process will fail. ![]() ![]() ![]() |
Beta Was this translation helpful? Give feedback.
Answered by
maticzav
Jul 4, 2023
Replies: 1 comment 9 replies
-
The From the tests and my experience, it should work correctly. Did you find a bug or just curious why it is like that? |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@huihuisang thank you for bringing this up and being so patient with me. You are correct that this was indeed an unhandled edge case.
To give you a bit of context, as I described in the PR, I think it's still better to specify
data
as non-nullable because otherwise, we need to modify a lot of code to account for the possibility ofdata
beingnil
and that collides with the TypeLocks which resolvenil
values themself, but I took it for granted that missing fields would work as well.Thanks!
#144