CoolOS
CoolOS

Reputation: 101

how to maintain a requestcontext across rest datasource in GraphQL

I wanted to know if i have multiple resolvers and in the resolvers which extends RESTDataSource . if i get access to context using this.context . is that the context that server has created for that particular request ? The reason I am asking this question is :- I see when from a RESTDatSource if i call another RESTDataSource then occasionally the context is getting over ridden for the chained call to a new context ( which is based on another request to server coming in same same time frame)

Upvotes: 0

Views: 374

Answers (1)

RAVI SINGH
RAVI SINGH

Reputation: 409

I don't know which framework you are using but if you are using ApolloServer then you can have different context object for each request. If you can explain where exactly you are facing this issue I can help more... :)

Upvotes: 1

Related Questions