Skip to content

Commit 92205f0

Browse files
mutation field description now defaults to null rather that empty string
1 parent 7312c84 commit 92205f0

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/mutation/__tests__/mutation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,19 +383,19 @@ describe('mutationWithClientMutationId()', () => {
383383
fields: [
384384
{
385385
name: 'simpleMutation',
386-
description: ''
386+
description: null
387387
},
388388
{
389389
name: 'simpleMutationWithDescription',
390390
description: 'Simple Mutation Description'
391391
},
392392
{
393393
name: 'simpleMutationWithThunkFields',
394-
description: ''
394+
description: null
395395
},
396396
{
397397
name: 'simplePromiseMutation',
398-
description: ''
398+
description: null
399399
},
400400
]
401401
}

src/mutation/mutation.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ type MutationConfig = {
5858
export function mutationWithClientMutationId(
5959
config: MutationConfig
6060
): GraphQLFieldConfig {
61-
var {name, inputFields, outputFields, mutateAndGetPayload} = config;
62-
var description = config.description != null ? config.description : '';
61+
var {
62+
name,
63+
inputFields,
64+
outputFields,
65+
mutateAndGetPayload,
66+
description
67+
} = config;
6368
var augmentedInputFields = () => ({
6469
...resolveMaybeThunk(inputFields),
6570
clientMutationId: {

0 commit comments

Comments
 (0)