These are chat archives for graphql-java/graphql-java

Apr 2017
Apr 26 2017 08:18
I wonder how we can update or insert an entire GraphQL Object in one time with mutation ?
By example this doesn't work :
GraphQLObjectType myObjectType = ...;

GraphQLObjectType mutationType = GraphQLObjectType.newObject()
            .type(myObjectType)) //this line doesn't work
Bojan Tomić
Apr 26 2017 09:05
Did you check why it isn't working? The error is quite clear: you can't use an output type as an input type. You need to make myInputObjectType that has the same structure as myObjectType. This is because input and output types have different constraints in GraphQL
Apr 26 2017 09:33
thx @kaqqao there is an example of an inputType ?
Bojan Tomić
Apr 26 2017 11:22
It's really no different than creating an GraphQLObjectType, just use the exact same style to create an GraphQLInputObjectType
Apr 26 2017 12:44
Thanks I try that ! :)