aiographql-client icon indicating copy to clipboard operation
aiographql-client copied to clipboard

Customize Payload on `CONNECTION_INIT`

Open abn opened this issue 3 years ago • 0 comments

Originally raised in #166 by @serializingme

Another issue I had was the need to have some extra data on the CONNECTION_INIT payload. I modified the connection_init_request in client\subscription.py:138 to add extra content to the returned dictionary:

return {
    "type": GraphQLSubscriptionEventType.CONNECTION_INIT.value,
    "payload": {**extra_data, "headers": {**self.request.headers}},
}

abn avatar Feb 25 '22 21:02 abn