How to apply directives on input object fields #1294
-
I have a field directive like this:
This works great on arguments, but it does not work on an input object field. My first thought was to do the same thing overriding onInputObjectField, but the get/set datafetcher methods don't exist:
Is there a way to do this on the fields of input objects? Or will this only work on arguments? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello 👋 |
Beta Was this translation helpful? Give feedback.
-
Ahh that makes sense thanks. We are on an older version of the library, so codeRegistry wasn’t available, but we will look into upgrading now.
Thanks for the quick response?
…________________________________
From: Dariusz Kuc ***@***.***>
Sent: Wednesday, October 27, 2021 5:33:14 PM
To: ExpediaGroup/graphql-kotlin ***@***.***>
Cc: Derek Towriss ***@***.***>; Author ***@***.***>
Subject: [External] Re: [ExpediaGroup/graphql-kotlin] How to apply directives on input object fields (Discussion #1294)
Hello 👋
In order to access the data fetcher you need to have schema coordinates and they are only available on the field (i.e. if you define an object it could be return from many different places during schema execution). Each directive environment has access to the raw code registry so while you won't get the convenient function to access the data fetcher, you still should be able to locate it in the registry (added in #1159<#1159>).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1294 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMADE4NA36BRO74Z5E5K5SDUJBVZVANCNFSM5G3LB2KQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
This e-mail message (including attachments, if any) is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary, confidential and exempt from disclosure. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender and delete this e-mail message immediately.
|
Beta Was this translation helpful? Give feedback.
Hello 👋
In order to access the data fetcher you need to have schema coordinates and they are only available on the field (i.e. if you define an object it could be return from many different places during schema execution). Each directive environment has access to the raw code registry so while you won't get the convenient function to access the data fetcher, you still should be able to locate it in the registry (added in #1159).