I am guessing the v3 branch was only used with GraphQLWSHandler, and not with GraphQLTransportWSHandler. That's probably why there were a bunch of bugs. This PR fixes the errors I got when trying to use subscriptions with the graphql-transport-ws protocol.
The first error I got was
Can't instantiate abstract class GraphQLTransportWSHandler with abstract method send_xjson
I implemented this function and the error went away.
Second error was with message types - they were TypedDicts, but typeddicts are essentially dicts.
This means additional fields specified are not properly used. I fixed it by converting them to dataclasses and adding a to_dict field to it.
I am guessing the
v3
branch was only used withGraphQLWSHandler
, and not withGraphQLTransportWSHandler
. That's probably why there were a bunch of bugs. This PR fixes the errors I got when trying to use subscriptions with thegraphql-transport-ws
protocol.The first error I got was
I implemented this function and the error went away.
Second error was with message types - they were
TypedDict
s, but typeddicts are essentially dicts. This means additional fields specified are not properly used. I fixed it by converting them todataclasses
and adding ato_dict
field to it.