feat: add in schema.py resolver fro _server
This commit is contained in:
parent
6ddfc11a91
commit
d9f47183c8
|
@ -1,4 +1,5 @@
|
||||||
scalar DateTime
|
scalar DateTime
|
||||||
|
|
||||||
type _Service {
|
type _Service {
|
||||||
sdl: String
|
sdl: String
|
||||||
}
|
}
|
||||||
|
@ -236,6 +237,8 @@ type Query {
|
||||||
topicsRandom(amount: Int): [Topic]!
|
topicsRandom(amount: Int): [Topic]!
|
||||||
topicsByCommunity(community: String!): [Topic]!
|
topicsByCommunity(community: String!): [Topic]!
|
||||||
topicsByAuthor(author: String!): [Topic]!
|
topicsByAuthor(author: String!): [Topic]!
|
||||||
|
|
||||||
|
# Apollo SDL
|
||||||
_service: _Service!
|
_service: _Service!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,13 @@ def serialize_datetime(value):
|
||||||
|
|
||||||
|
|
||||||
query = QueryType()
|
query = QueryType()
|
||||||
|
|
||||||
|
@query.field("_service")
|
||||||
|
def resolve_service(*_):
|
||||||
|
print("Inside the _service resolver")
|
||||||
|
# For now, return a placeholder SDL.
|
||||||
|
sdl = "type Query { _service: _Service } type _Service { sdl: String }"
|
||||||
|
return {"sdl": sdl}
|
||||||
|
|
||||||
mutation = MutationType()
|
mutation = MutationType()
|
||||||
resolvers = [query, mutation, datetime_scalar]
|
resolvers = [query, mutation, datetime_scalar]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user