Pre-loading with filter #1455
Unanswered
lukas-krecan
asked this question in
Q&A
Replies: 2 comments
-
The closest we were able to get was to somehow use the |
Beta Was this translation helpful? Give feedback.
0 replies
-
This needs to be fixed in the schema, i.e. if there is an input that needs
to come the user, in this case the filter, you will need to update shows to
take filter as input argument, i.e.
```
type Query {
shows(filter: Filter) : [Show]
}
```
If the filter is not provided by the user but will be available as part of
processing the shows query, you can pass it down to child data fetchers
using the local context. Check out an example here:
https://netflix.github.io/dgs/advanced/context-passing/#no-showid-use-local-context
You will need to get the local context from the data fetching environment
in this case.
Hope this helps.
…On Thu, Mar 16, 2023 at 5:32 AM Lukáš Křečan ***@***.***> wrote:
The closest we were able to get was to somehow use the
ValuesResolver.literalToInternalValue and then DefaultInputObjectMapper
to deserialize it.
—
Reply to this email directly, view it on GitHub
<#1455 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXM6PEWRG7CUJZOSW4TW4MB6VANCNFSM6AAAAAAV5EROD4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
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
-
Let's say I have the following schema
I want to use pre-loading to fetch reviews in one DB query with shows as I can easily join it in the DB. Moreover implementing it effectively using DataLoaders is far from straightforward. The question is how to access the review filter
MyFilter
from the shows fetcher?Beta Was this translation helpful? Give feedback.
All reactions