In my React application I am using graphQL code generator for generating query and mutation React hooks (I am using Apollo client). Generated queries work just fine, but when it comes to mutation I am getting this error :
message: "Error trying to resolve field 'createSuborder'.", locations: [{line: 2, column: 3
Here is my important part of graphQL schema :
Weird thing is that when I try to run this mutation in graphQL playground it works.
Here is my generated code from codegen, and hook used in my React component.
const [createSuborderMutation, { data, loading, error }] =
useCreateSuborderMutation({
variables: {
tableId: 17,
meals: [{ id: 1, count: 2 }],
drinks: [{ id: 1, count: 3 }],
token: "bpTtlPuC",
},
});