Skip to content

Commit

Permalink
apply new object params when using mutation resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Jan 30, 2021
1 parent 2134bcd commit 45c1767
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/graphqlProtocol/mutation.ts
Expand Up @@ -69,19 +69,19 @@ export const generateMutations = (graphRegistry) => {
type: new GraphQLNonNull(mutationInputType),
},
},
resolve: getMutationResolver(
resolve: getMutationResolver({
entity,
entityMutation,
typeName,
false,
({ args }) => {
nested: false,
idResolver: ({ args }) => {
return extractIdFromNodeId(
graphRegistry,
entity.name,
args.input.nodeId,
);
},
),
}),
};

if (entityMutation.isTypeCreate || entityMutation.isTypeUpdate) {
Expand Down Expand Up @@ -115,19 +115,19 @@ export const generateMutations = (graphRegistry) => {
type: new GraphQLNonNull(mutationInputNestedType),
},
},
resolve: getMutationResolver(
resolve: getMutationResolver({
entity,
entityMutation,
typeName,
true,
({ args }) => {
nested: true,
idResolver: ({ args }) => {
return extractIdFromNodeId(
graphRegistry,
entity.name,
args.input.nodeId,
);
},
),
}),
};
}

Expand Down Expand Up @@ -162,15 +162,15 @@ export const generateMutations = (graphRegistry) => {
type: new GraphQLNonNull(mutationByPrimaryAttributeInputType),
},
},
resolve: getMutationResolver(
resolve: getMutationResolver({
entity,
entityMutation,
typeName,
false,
({ args }) => {
nested: false,
idResolver: ({ args }) => {
return args.input[fieldName];
},
),
}),
};
}
}
Expand Down

0 comments on commit 45c1767

Please sign in to comment.