Added gql base #181
This commit is contained in:
13
example/api/src/queries/hello.py
Normal file
13
example/api/src/queries/hello.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import graphene
|
||||
|
||||
from cpl.graphql.schema.query import Query
|
||||
|
||||
|
||||
class HelloQuery(Query):
|
||||
def __init__(self):
|
||||
Query.__init__(self)
|
||||
self.string_field(
|
||||
"message",
|
||||
args={"name": graphene.String(default_value="world")},
|
||||
resolver=lambda *_, name: f"Hello {name}",
|
||||
)
|
||||
Reference in New Issue
Block a user