In the GraphQL spec, objects and input objects are distinct things. While an implementation might provide convenience code (see below) to create an object and a corresponding input object from a single definition, under the covers, the spec indicates that they’ll have to be separate things.
Consider:
const RelativeTemplate = name => {
return {
name: name,
fields: () => ({
name: { type: GraphQLString },
reference: { type: GraphQLString }
})
};
};
const RelativeType = {
input: new GraphQLInputObjectType(RelativeTemplate("RelativeInput")),
output: new GraphQLObjectType(RelativeTemplate("RelativeOutput"))
};