Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_context() to prepare a context object #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cpd67
Copy link

@cpd67 cpd67 commented Aug 15, 2023

Hello! This PR refs #104. It adds a new get_context() method on the GraphqlWsClient which can be overridden to inject values into the context. Usage would be similar to how you add things to a Django view's context:

def get_context(self):
    context = super().get_context()
    context.user = self.scope.get('user')
    context.other_attr = 'test'
    return context

@cpd67 cpd67 force-pushed the master branch 4 times, most recently from e74836d to b963595 Compare August 15, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant