Losing asgiref.Local value with async graphql resolvers #124
Unanswered
ZipBrandon
asked this question in
Q&A
Replies: 1 comment 10 replies
-
Hola @ZipBrandon. Can you give me more information so I can try to reproduce? |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using https://strawberry.rocks/ as my GraphQL library. Everything works as expected with django-pgschemas when using it synchronously.
get_current_schema()
will return the schema I activated in myTenantProtocolRouter
subclass. When I convert a query resolver to async (by introducing the async keyword to the function definition) then I receive a<django_pgschemas.schema.SchemaDescriptor object at 0xffff7114ecb0>
when I callget_current_schema()
and the tenant that I activated doesn't appear to be in the scope of the executing query resolver. I don't have a great understanding ofasgiref.Local
so I don't know if this would be expected. I migrated fromdjango-tenants
to circumvent the storing of the tenant on theconnection
and was hopingdjango-pgschemas
's solution would help. Is there something that I could be conceptually missing?Beta Was this translation helpful? Give feedback.
All reactions