Skip to content

Nested inputs fail parsing #17

@jim-hill-r

Description

@jim-hill-r

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions