is there a mismatch between urqls Operation
and graphql-ws SubscribePayload
?
#166
Answered
by
enisdenjo
97amarnathk
asked this question in
Q&A
-
While using graphql-ws with urql , I notice that there is a type mismatch between the SubscribePayload received by graphql-ws server and what urql is sending to it. According to graphql-ws, the type is export interface SubscribePayload {
readonly operationName?: string | null;
readonly query: string;
readonly variables?: Record<string, unknown> | null;
} And according to urql it is export interface Operation<Data = any, Variables = any>
extends GraphQLRequest<Data, Variables> {
readonly kind: OperationType;
context: OperationContext;
} And this operation is being passed directly to the graphql-ws client as: forwardSubscription: (operation) => {
return {
subscribe: (sink) => {
const dispose = subscriptionClient.subscribe(operation, sink);
return {
unsubscribe: dispose,
};
},
}; |
Beta Was this translation helpful? Give feedback.
Answered by
enisdenjo
Apr 23, 2021
Replies: 1 comment 16 replies
-
The |
Beta Was this translation helpful? Give feedback.
16 replies
Answer selected by
97amarnathk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
Operation
interface extendsGraphQLRequest
which has the necessary fields for the payload (query
andvariables
).