How to add JSON type attribute in directive annotation class #1913
-
I am creating a custom directive, I have requirement of adding non primitive types attribute something like below: @GraphQLDirective
annotation class Test(
val name: String,
val data: JSON,
val obj: CustomObject
) What I read from the documentation is, annotation class doesn't support custom types. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hello 👋
|
Beta Was this translation helpful? Give feedback.
@kschat TLDR is that you can do any sort of modifications through raw GraphQL objects (see example impl of directive with custom input object argument). It is doable.... but it is far from the best user experience.
You need to:
re: NULL/optional arg support for arguments -> see #1830. Since you can provide those type definitions, you certainly can mark those fields as nullable.... but we are limited by JVM which does not support it, so if you want to apply them in your …