mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-14 05:36:45 +03:00
Update to use partial instead of lambda function
This commit is contained in:
parent
e7b5358604
commit
d971fbb4dc
|
@ -1,3 +1,5 @@
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from graphql.core.type import GraphQLUnionType
|
from graphql.core.type import GraphQLUnionType
|
||||||
|
|
||||||
|
@ -35,6 +37,6 @@ class UnionType(six.with_metaclass(UnionTypeMeta, FieldsClassType)):
|
||||||
return GraphQLUnionType(
|
return GraphQLUnionType(
|
||||||
cls._meta.type_name,
|
cls._meta.type_name,
|
||||||
types=list(map(schema.T, cls._meta.types)),
|
types=list(map(schema.T, cls._meta.types)),
|
||||||
resolve_type=lambda instance, info: cls._resolve_type(schema, instance, info),
|
resolve_type=partial(cls._resolve_type, schema),
|
||||||
description=cls._meta.description,
|
description=cls._meta.description,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user