'How to use more than one pubsub in javascript grapql?
I want to use Google PubSub and Redis PubSub provided by Google Cloud in Javascript GraphQL(apollo-server).
I tried to create 2 subscription fields, but I couldn't get the result I wanted.
this, it said that subscriptions do not provide more than two root fields.
How can I subscribe to 2 pubSub objects?
The code I used is like below.
Subscription: {
operation: {
subscribe: withFilter(
(_, { channelId }, { pubSub }) => pubSub.asyncIterator(getTopic(channelId)),
(payload, variables) => {
// Some Code...
}
),
},
},
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
