Skip to content

Commit a8bca06

Browse files
fix: Allow empty field map
1 parent bc36a09 commit a8bca06

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Sources/GraphQL/Type/Definition.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,6 @@ extension GraphQLObjectType: Hashable {
394394
}
395395

396396
func defineFieldMap(name: String, fields: GraphQLFieldMap) throws -> GraphQLFieldDefinitionMap {
397-
guard !fields.isEmpty else {
398-
throw GraphQLError(
399-
message:
400-
"\(name) fields must be an object with field names as " +
401-
"keys or a function which returns such an object."
402-
)
403-
}
404-
405397
var fieldMap = GraphQLFieldDefinitionMap()
406398

407399
for (name, config) in fields {

0 commit comments

Comments
 (0)