Skip to content

Commit 883ac8d

Browse files
committed
Removes default values for required fields in GraphQL*Config types
1 parent e590dd2 commit 883ac8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/type/definition.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ function defineFieldMap<TSource, TContext>(
758758
| GraphQLInterfaceTypeConfig<TSource, TContext>,
759759
>,
760760
): GraphQLFieldMap<TSource, TContext> {
761-
const fieldMap = resolveThunk(config.fields) || {};
761+
const fieldMap = resolveThunk(config.fields);
762762
devAssert(
763763
isPlainObj(fieldMap),
764764
`${config.name} fields must be an object with field names as keys or a function which returns such an object.`,
@@ -1147,7 +1147,7 @@ defineToJSON(GraphQLUnionType);
11471147
function defineTypes(
11481148
config: $ReadOnly<GraphQLUnionTypeConfig<mixed, mixed>>,
11491149
): Array<GraphQLObjectType> {
1150-
const types = resolveThunk(config.types) || [];
1150+
const types = resolveThunk(config.types);
11511151
devAssert(
11521152
Array.isArray(types),
11531153
`Must provide Array of types or a function which returns such an array for Union ${config.name}.`,
@@ -1430,7 +1430,7 @@ defineToJSON(GraphQLInputObjectType);
14301430
function defineInputFieldMap(
14311431
config: $ReadOnly<GraphQLInputObjectTypeConfig>,
14321432
): GraphQLInputFieldMap {
1433-
const fieldMap = resolveThunk(config.fields) || {};
1433+
const fieldMap = resolveThunk(config.fields);
14341434
devAssert(
14351435
isPlainObj(fieldMap),
14361436
`${config.name} fields must be an object with field names as keys or a function which returns such an object.`,

0 commit comments

Comments
 (0)