Replies: 2 comments 7 replies
Did you consider Ariadne GraphQL Modules? |
3 replies
|
Can you show GraphQL schema? I don't understand why you are setting same resolver to multiple fields: @query_layers.field("layers")
@query_layers.field("layer")You don't have to call _, bearer = parse_authorization(request)
context_value = {
"request": request,
"bearer": bearer,
}
graphql_sync(..., context_value=context_value)Then in resolvers: @query_layers.field("layers")
@query_layers.field("layer")
async def resolve_layers(_, info, **kwargs):
return await Layers(bearer=info.context["bearer"], route="layers", **kwargs).get_all() |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello people, I hope you understand my question since I don't speak English very well. I have generated a project in flask that works correctly, but when modularizing, I don't know how I could use a "querytype" without having to call it so many times.
I leave you a concrete example of two resolvers... and how I call them in api.py
1-
2-
3- Call
what I'm looking for, is to reduce that list of "query_types" to maybe a class or something similar.
All reactions