Skip to content

Conversation

Pelleplutt
Copy link
Contributor

Add init_payload parameter to GraphqlClient.subscribe() allowing
override of payload sent in connection_init call to peer when
initializing the socket.

What kind of change does this PR introduce?

Minor feature add to allow override of payload when setting up the subscription socket. I have found this useful as some gql subscriptions require information such as tokens etc. in this initial payload. Change should be backwards_compatible.

Add init_payload parameter to GraphqlClient.subscribe() allowing
override of payload sent in connection_init call to peer when
initializing the socket.
@DaleSeo
Copy link
Contributor

DaleSeo commented Nov 16, 2020

@Pelleplutt Thanks you for contributing to the project. It looks good to me overall but can you format your code with Black so that it can pass our CI? Alternatively, you can use pre-commit as guided in CONTRIBUTING.md. I would also appreciate it if you could update the unit tests to account for your changes.

@DaleSeo DaleSeo added the enhancement New feature or request label Nov 16, 2020
@Pelleplutt
Copy link
Contributor Author

Sure, sorry for not doing my homework. Basic test added, formatting cleaned up. I refrained from making a negative corresponding test in the TestGraphqlClientSubscriptions.test_headers_passed_to_websocket_connect() test as it felt superflous, let me know if you disagree.

Copy link
Contributor

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pelleplutt Thanks a lot for addressing my feedback!

@DaleSeo DaleSeo merged commit fe1986d into prodigyeducation:master Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants