-
I want to use graphql-ws client in miniprogram with uniapp,but the miniprogram has custom webscoket api. such as:
so I need to define webSocketImpl with these api |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I don’t know what api has used in graphql-ws, It confuses me. |
Beta Was this translation helpful? Give feedback.
-
WebSocket implementation in the global scope of JavaScript can only be the web WebSocket API; meaning, your custom thing has to implement its interface. Maybe this link should be added to the description. 🤔 |
Beta Was this translation helpful? Give feedback.
I think that adapting your custom API to match the web WebSocket API is an easier task compared to implementing the transport yourself from scratch.
However, if you decide to go for a custom implementation - you should rely on the GraphQL over WebSocket spec.