Changed to strawberry #181
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from cpl.graphql.schema.filter.filter import Filter
|
||||
from cpl.graphql.schema.object_graph_type import ObjectGraphType
|
||||
from cpl.graphql.schema.graph_type import GraphType
|
||||
|
||||
from cpl.graphql.schema.sort.sort import Sort
|
||||
from cpl.graphql.schema.sort.sort_order import SortOrder
|
||||
@@ -25,15 +25,15 @@ class CitySort(Sort[City]):
|
||||
self.field("name", SortOrder)
|
||||
|
||||
|
||||
class CityGraphType(ObjectGraphType):
|
||||
class CityGraphType(GraphType[City]):
|
||||
def __init__(self):
|
||||
ObjectGraphType.__init__(self)
|
||||
GraphType.__init__(self)
|
||||
|
||||
self.string_field(
|
||||
self.int_field(
|
||||
"id",
|
||||
resolver=lambda user, *_: user.id,
|
||||
resolver=lambda root: root.id,
|
||||
)
|
||||
self.string_field(
|
||||
"name",
|
||||
resolver=lambda user, *_: user.name,
|
||||
resolver=lambda root: root.name,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user