Diana.jl icon indicating copy to clipboard operation
Diana.jl copied to clipboard

Nested inputs fail parsing

Open jim-hill-r opened this issue 4 years ago • 3 comments

Describe the bug When using nested Input types, the parser fails with the following error: Error: ErrorException("type Object_ has no field value")

To Reproduce Steps to reproduce the behavior:

  1. Set up schema as such:
input NestedInput {
  aThing: String
  bThing: String
}

input BaseInput {
  nestedThing: NestedInput
  otherThing: String
}

type Query {
  hello: String
}

type Mutation {
  failingFunction(input: BaseInput ): String
}

schema {
  query: Query
  mutation: Mutation
}
  1. Set up resolvers as such:
Dict(
    "Query" => Dict(
      "hello" => (root, args, ctx, info) -> (return "world")
    ),
    "Mutation" => Dict(
      "failingFunction" => (root, args, ctx, info) -> begin
        println(args)
        # ARGs will not properly parse and drop into this function
    end
    )
)
  1. Run following query
mutation { failingFunction(input:{nestedThing:{aThing:"test",bThing:"test"},otherThing:"test"}) }
  1. Error should occur:
Error: ErrorException("type Object_ has no field value")

Expected behavior The args should arrive to the resolver as nested Dicts.

jim-hill-r avatar Jul 07 '20 15:07 jim-hill-r

Thanks for your issue, you are right the nested input types are not working properly, we are preparing to launch a new version (0.3) in which we will rebuild the entire package from the kernel. So we hope to be able to solve this problem in the next version.

neomatrixcode avatar Jul 07 '20 19:07 neomatrixcode

Awesome to hear! If you need some beta testers, let me know. I would love to transition my Apollo workloads over to Julia native workloads.

jim-hill-r avatar Jul 07 '20 19:07 jim-hill-r

Excellent thank you very much. I will contact you when the beta phase starts.

neomatrixcode avatar Jul 07 '20 19:07 neomatrixcode