Fork me on GitHub
Lennart Buit22:12:32

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 ^^?

Lennart Buit22:12:19

(I’m just exploring what is currently already possible with directives in lacinia)

Lennart Buit22:12:51

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)


No, that could easily be a gap in what is currently possible, and it shouldn’t be.

Lennart Buit10:12:06

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.