We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c19593 commit 0e3c952Copy full SHA for 0e3c952
graphql/type/definition.py
@@ -521,14 +521,14 @@ def _define_field_map(self):
521
if callable(fields):
522
fields = fields()
523
524
- if not isinstance(fields, OrderedDict):
525
- fields = OrderedDict(sorted(list(fields.items())))
526
-
527
assert isinstance(fields, collections.Mapping) and len(fields) > 0, (
528
'{} fields must be a mapping (dict / OrderedDict) with field names as keys or a '
529
'function which returns such a mapping.'
530
).format(self)
531
+ if not isinstance(fields, OrderedDict):
+ fields = OrderedDict(sorted(list(fields.items())))
+
532
for field_name, field in fields.items():
533
assert_valid_name(field_name)
534
0 commit comments