I am building micro services using graphQl. I have build a gateway which calls all service. I need to implement retry logic in it. I am writing the following code...
const gateway = new ApolloGateway({
serviceList: [
{ name: "task service", url: "http://localhost:8001/graphql" },
{ name: "resource service", url: "http://localhost:8002/graphql" }
],
__exposeQueryPlanExperimental: false,
});
const apolloServer = new ApolloServer({
gateway,
subscriptions: false,
context: async () => {
new RetryLink({
delay: {
initial: 7000,
max: Infinity,
jitter: true
},
attempts: {
max: 5,
retryIf: (error, _operation) => !!error
}
});
}
});
But it does not work. Can anyone help us how we can implement retry logic in it. Although it is working on client side with react.
question from:
https://stackoverflow.com/questions/66059447/retry-logic-implementation-on-graphql-server 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…