You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I filed this issue as graphql-python/graphene-mongo#198 in graphene-mongo, but possibly the solution should be implemented in graphql-server)
A graphql resolver function is provided a context which can hold important information like the currently logged in user or the current HTTP request
In Graphene, graphene-django, graphene-mongo and the old flask-graphql , the context is an object that can have attributes read and written to it (for example context.db.loadHumanByID(args.id) ). However, graphql-server provides a dict that must be accessed by key name e.g. context['request']
If we were programming in Javascript, both syntaxes would work. It would be nice if the context provided by graphql-server could be made more flexible, for instance by making the default context a collections.UserDict.
edit: I see now that the class property context on the GraphQLView can be specified, so that let's me workaround my particular use case
The text was updated successfully, but these errors were encountered:
(I filed this issue as graphql-python/graphene-mongo#198 in graphene-mongo, but possibly the solution should be implemented in graphql-server)
A graphql resolver function is provided a context which can hold important information like the currently logged in user or the current HTTP request
In Graphene, graphene-django, graphene-mongo and the old flask-graphql , the context is an object that can have attributes read and written to it (for example
context.db.loadHumanByID(args.id)
). However, graphql-server provides a dict that must be accessed by key name e.g.context['request']
If we were programming in Javascript, both syntaxes would work. It would be nice if the context provided by graphql-server could be made more flexible, for instance by making the default context a
collections.UserDict
.edit: I see now that the class property
context
on the GraphQLView can be specified, so that let's me workaround my particular use caseThe text was updated successfully, but these errors were encountered: