Skip to content

Commit d90ff05

Browse files
set field description to undefined if not in config to better conform to type
1 parent 2000316 commit d90ff05

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/mutation/mutation.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,9 @@ type MutationConfig = {
5858
export function mutationWithClientMutationId(
5959
config: MutationConfig
6060
): GraphQLFieldConfig {
61-
var {
62-
name,
63-
inputFields,
64-
outputFields,
65-
mutateAndGetPayload,
66-
description
67-
} = config;
61+
var { name, inputFields, outputFields, mutateAndGetPayload } = config;
62+
63+
var description = config.description ? config.description : undefined;
6864
var augmentedInputFields = () => ({
6965
...resolveMaybeThunk(inputFields),
7066
clientMutationId: {
@@ -88,7 +84,7 @@ export function mutationWithClientMutationId(
8884
fields: augmentedInputFields
8985
});
9086

91-
return {
87+
var mutationField = {
9288
type: outputType,
9389
description: description,
9490
args: {
@@ -101,4 +97,6 @@ export function mutationWithClientMutationId(
10197
});
10298
}
10399
};
100+
101+
return mutationField;
104102
}

0 commit comments

Comments
 (0)