Skip to content

Commit 097319e

Browse files
committed
Fix GraphQLInputObjectType default values
1 parent 96977a0 commit 097319e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/build/buildInputObject.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GraphQLInputObjectType } from 'graphql/type';
1+
import { GraphQLInputObjectType, getNamedType } from 'graphql/type';
22
import { getDescription } from 'graphql/utilities/buildASTSchema';
33
import produceType from './produceType';
44

@@ -10,7 +10,7 @@ export const buildInputObjectConfigFieldMap = (inputObjectAST, types) =>
1010
const description = getDescription(inputValueAST);
1111
const inputObjectFieldConfig = { type };
1212
if (defaultValue !== null) {
13-
inputObjectFieldConfig.defaultValue = type.parseLiteral(defaultValue);
13+
inputObjectFieldConfig.defaultValue = getNamedType(type).parseLiteral(defaultValue);
1414
}
1515
if (description) inputObjectFieldConfig.description = description;
1616
return { ...map, [name]: inputObjectFieldConfig };

0 commit comments

Comments
 (0)