diff --git a/schemas/core.graphql b/schemas/core.graphql index c8d74912..7d2ac3a3 100644 --- a/schemas/core.graphql +++ b/schemas/core.graphql @@ -1,4 +1,5 @@ scalar DateTime + type _Service { sdl: String } @@ -236,6 +237,8 @@ type Query { topicsRandom(amount: Int): [Topic]! topicsByCommunity(community: String!): [Topic]! topicsByAuthor(author: String!): [Topic]! + + # Apollo SDL _service: _Service! } diff --git a/services/schema.py b/services/schema.py index fe7cc129..e6b9c593 100644 --- a/services/schema.py +++ b/services/schema.py @@ -10,5 +10,13 @@ def serialize_datetime(value): 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() resolvers = [query, mutation, datetime_scalar]