So I was trying ^that out, right. I have a mutation that has a single input (relay style) which is an input type that has fields with directives. Say:
mutation {
createUser(input: CreateUserInput!): CreateUserPaylaod
}
input CreateUserInput {
userName: String! @myDirective
}
Now, looking through the selection (e.g. executor/selection
), I’m trying to find this userName
field with its directive. However, in (:field-definition selection)
I can find that createUser
has an argument named input
with a type of CreateUserInput
, but I can’t seem to find the definition of this input type, and consequently the directive on this userName
input type field. Is that not yet exposed ^^?That’s cool tho, I think I may be able to reconstruct it via the schema, and the knowledge that inputs are guaranteed non recursive
You can now go from a field selection to a Field and pick up the type system directives on the Field itself.
But I will in the future add a way to go to the schema type, not just the type name.
(I’m just exploring what is currently already possible with directives in lacinia)
Given the context, I can seem to find it in the schema, e.g.
(:CreateUserInput (:com.walmartlabs.lacinia.constants/schema context))
But, as far as I can tell (am I missing something obvious here?), I can’t find it in the selection part of that same context (the subselection I get from executor/selection
)