Skip to content

List of Object as Input in Mutation #41

@zerounix

Description

@zerounix

Hi,

i have a question about parameter passing in a mutation.

My schema looks something like this:

input KeyValuePairInput {
    key: String!
    value: String!
    valueType: ValueTypeEnum
}
enum ValueTypeEnum {
    Int
    Float
    String
    Boolean
}

with a Mutation and a method in it:

someFunction(
        name: String!
        key: String
        variables: [KeyValuePairInput]
    ): SomeReturn

The corresponding Resolver for my Mutation has a public method

public class Mutation implements GraphQLRootResolver {
..
    public SomeReturn someFunction(String name, String key, ArrayList<KeyValuePairInput> variables) {}
}

Now when a call the mutation, the Java method gets called, but the type of the variables is ArrayList. Am i missing something here? I expected it to be ArrayList.

Sorry if the question is stupid, but i can't find a solution to this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions