Acces request variables in field resolver #800
Answered
by
MichalLytek
vytautas-pranskunas-
asked this question in
Q&A
-
Hi, I am migrating to type-graphql and previously i havd this field resolver:
cannot find how to access request args (info.variableValues) in field resolver.
|
Beta Was this translation helpful? Give feedback.
Answered by
MichalLytek
Mar 1, 2021
Replies: 2 comments 6 replies
Answer selected by
MichalLytek
-
It is when you know it 😉 it is not so obvious that you can reference
additional paramos and more not obvious their types.
Thanks
…On Mon, Mar 1, 2021, 2:23 PM Michał Lytek ***@***.***> wrote:
There's no API reference as it's super straightforward:
***@***.***() order: Order, @Info() info: GraphQLResolveInfo) {
return order.messages.findIndex(m => m.userId.toHexString() !== (info.variableValues as ListItemsFilter).userId && !m.seen) !== -1;}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#800 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA54ZFZ2WP2O5XBKBPBCQR3TBOIN5ANCNFSM4YMM5SOA>
.
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Info()