Can't get child fetcher to be invoked #192
-
|
Hi all, I'm trying to follow the demos on the documentation, and so far I have the same schema as the demo, and a simple class that provides the fetchers:
@DgsComponent
public class ClientDataFetcher {
private final List<Show> shows = Arrays.asList(
new Show("1", "Stranger Things", null),
new Show("2", "Ozark", null)
);
private final List<Review> reviews = Arrays.asList(
new Review(1),
new Review(2),
new Review(3)
);
@DgsData(parentType = "Query", field = "shows")
public List<Show> shows(@InputArgument("titleFilter") String titleFilter) {
if(titleFilter == null) {
return shows;
}
return shows.stream().filter(s -> s.getTitle().contains(titleFilter)).collect(Collectors.toList());
}
@DgsData(parentType = "Show", field = "reviews")
List<Review> reviews(DgsDataFetchingEnvironment dfe) {
Show show = dfe.getSource();
return reviews;
}
}When running the application, I can make the following query and I get the following result When debugging, the execution never passes through the method Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
Just figured it out, I was missing the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for pointing this out. Will fix.
…On Fri, Apr 9, 2021 at 8:42 AM Grant Gochnauer ***@***.***> wrote:
cc: @paulbakker <https://github.com/paulbakker>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#192 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXIKAU27QD5DWKCDWG3TH4N6JANCNFSM4ZW272XQ>
.
|
Beta Was this translation helpful? Give feedback.
-
|
Fixed by Netflix/dgs#27.
On Fri, Apr 9, 2021 at 9:58 AM Kavitha Srinivasan ***@***.***>
wrote:
… Thanks for pointing this out. Will fix.
On Fri, Apr 9, 2021 at 8:42 AM Grant Gochnauer ***@***.***>
wrote:
> cc: @paulbakker <https://github.com/paulbakker>
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#192 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AJ5JPXIKAU27QD5DWKCDWG3TH4N6JANCNFSM4ZW272XQ>
> .
>
|
Beta Was this translation helpful? Give feedback.
Just figured it out, I was missing the
publicmodifier in thereviewsmethod!Thanks!