Giovanni Lobitos
Giovanni Lobitos

Reputation: 852

Apollo GraphQL Mutation (Object Argument)

So, I'm trying to design my Apollo server. I wanted to create a mutation with an object as a parameter.

Here is a snippet of my schema which somehow caused the problem:

enter image description here

I thought it was syntactically correct, but I ran into this error:

{"errors":[{"message":"Expected Input type."}]}

Upvotes: 3

Views: 1621

Answers (1)

helfer
helfer

Reputation: 7172

You have to declare INPUT_OBJECT to be an input type:

input INPUT_OBJECT {
  field1: String,
  # etc.
}

Upvotes: 11

Related Questions