Batched field resolver #778
Unanswered
PaulFranken
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
The @Skip and @include directives are supported by graphql-java already and
the framework should allow you to use them as well.
…On Fri, Dec 10, 2021 at 4:08 AM Paul Franken ***@***.***> wrote:
Hi,
I'm trying to figure out wether it is possible within DGS to
include/exclude fields based on a check, without having to execute that
check on every entity in the request.
For example, retrieving a list of 10.000 objects and doing a single check
to exclude a property of those objects based on the user type, thereby
preventing the querying of the child objects from the database on every
single object.
Basically the functionality of the @Skip <https://github.com/Skip> and
@include <https://github.com/include> directives.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#778>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXMKUD6CNWGYRHG372DUQHUTRANCNFSM5JY7H6HA>
.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Yes, that would happen each time the resolver/fetcher for the parent of the
field is called, if @Skip and @include functionality is what you are
looking for. The other option would be to populate all the fields at the
parent level where you can better control what is fetched instead. You can
use the look ahead functionality by inspecting the data fetching
environment to see what fields are requested, if that is what you are using
to check.
https://www.graphql-java.com/blog/deep-dive-data-fetcher-results/
…On Fri, Dec 10, 2021 at 2:41 PM Paul Franken ***@***.***> wrote:
That would still require a check to be done per entity, in this case
10.000 times, right?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#778 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXOQ776C2MTGPV5P3GDUQJ63HANCNFSM5JY7H6HA>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to figure out wether it is possible within DGS to include/exclude fields based on a check, without having to execute that check on every entity in the request.
For example, retrieving a list of 10.000 objects and doing a single check to exclude a property of those objects based on the user type, thereby preventing the querying of the child objects from the database on every single object.
Basically the functionality of the @Skip and @include directives.
Beta Was this translation helpful? Give feedback.
All reactions