Changed to strawberry #181
This commit is contained in:
@@ -1,6 +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 +24,16 @@ class UserSort(Sort[User]):
|
||||
self.field("name", SortOrder)
|
||||
|
||||
|
||||
class UserGraphType(ObjectGraphType):
|
||||
def __init__(self):
|
||||
ObjectGraphType.__init__(self)
|
||||
class UserGraphType(GraphType[User]):
|
||||
|
||||
self.string_field(
|
||||
def __init__(self):
|
||||
GraphType.__init__(self)
|
||||
|
||||
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