Skip to content

How to add JSON type attribute in directive annotation class #1913

Answered by dariuszkuc
Sandip888831 asked this question in Q&A
Discussion options

You must be logged in to vote

@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:

  • manually provide type definition for that directive input object definition
  • manually transform your applied directive to correctly process the arguments
  • in directive wiring manually parse out the values from inner object

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 …

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@Sandip888831
Comment options

@dariuszkuc
Comment options

@kschat
Comment options

@dariuszkuc
Comment options

Answer selected by Sandip888831
@dariuszkuc
Comment options

@dariuszkuc
Comment options

@Sandip888831
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants