Data fetcher not being invoked, query fails with non-null field is null #648
-
Example reproducer for this is at: https://github.com/shuston/dgs-example I have a schema with a simple interface, and a type implementing it and a query to return these things:
My query handler returns an object without the fields of the DefinedGroup filled in:
And then I'm expecting a resolver for the 'items' field to be called:
However, this resolver for items is not called, and the query fails with:
Am I misunderstanding how this is supposed to work? Any suggestions for making it work? Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @shuston, the reason is that your
I have to admit that it took me quite a bit of head-scratching to find this, it's really not obvious. I wasn't really aware the |
Beta Was this translation helpful? Give feedback.
-
And the issue as promised: #656 |
Beta Was this translation helpful? Give feedback.
Hi @shuston, the reason is that your
items
datafetcher was missing thepublic
keyword.This works:
I have to admit that it took me quite a bit of head-scratching to find this, it's really not obvious. I wasn't really aware the
public
is required, and nobody has complained so far. I'll create an issue to fix this.