feat: wildcard to resolvers , and find that load_resolvers are not added

This commit is contained in:
2023-10-06 03:24:31 -03:00
parent e27b0ae42b
commit b6b39a457c
2 changed files with 12 additions and 8 deletions

View File

@@ -1,14 +1,20 @@
from ariadne import ScalarType, QueryType, MutationType
from resolvers.service import service_resolvers
datetime_scalar = ScalarType("DateTime")
@datetime_scalar.serializer
def serialize_datetime(value):
return value.isoformat
return value.isoformat()
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, service_resolvers]
resolvers = [query, mutation, datetime_scalar]