Is there a way to trigger data fetcher if a specific field is requested irrespective of it's parent #532
-
|
I would like to trigger a data fetcher when the request is for a specific attribute/field. This field can be part of multiple Types. e.g., With this structure, if the request is for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I might be misunderstanding the question. But here's an attempt at an answer. You can just define the datafetcher for This would define a single datafetcher that works for both |
Beta Was this translation helpful? Give feedback.
I might be misunderstanding the question. But here's an attempt at an answer. You can just define the datafetcher for
fromAon either the interface type or the concrete types.This would define a single datafetcher that works for both
OneandTwo. Alternatively you can create the datafetcher for the implementing type explicitly: