mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-26 19:43:56 +03:00
Improved logic in GroupNamedType
This commit is contained in:
parent
12e4e2c006
commit
c9e7f67ff9
|
@ -143,8 +143,11 @@ class GroupNamedType(BaseType):
|
|||
name = type.name or type.attname
|
||||
return name, schema.T(type)
|
||||
|
||||
def iter_types(self, schema):
|
||||
return map(partial(self.get_named_type, schema), self.types)
|
||||
|
||||
def internal_type(self, schema):
|
||||
return OrderedDict(map(partial(self.get_named_type, schema), self.types))
|
||||
return OrderedDict(self.iter_types(schema))
|
||||
|
||||
def __len__(self):
|
||||
return len(self.types)
|
||||
|
|
|
@ -145,11 +145,9 @@ class InputField(NamedType, OrderedType):
|
|||
|
||||
|
||||
class FieldsGroupType(GroupNamedType):
|
||||
def internal_type(self, schema):
|
||||
fields = []
|
||||
def iter_types(self, schema):
|
||||
for field in sorted(self.types):
|
||||
try:
|
||||
fields.append(self.get_named_type(schema, field))
|
||||
yield self.get_named_type(schema, field)
|
||||
except SkipField:
|
||||
continue
|
||||
return OrderedDict(fields)
|
||||
|
|
Loading…
Reference in New Issue
Block a user