Disposed HttpClient Issue When Using WithHttpClient in StrawberryShake #9362
Unanswered
praveengopalan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using StrawberryShake in my project to retrieve data from other microservices. The microservice URL contains a version segment that may change depending on the customer configuration, so the GraphQL client endpoint needs to be resolved dynamically.
To support this, I configured the client using WithHttpClient. In some scenarios, within the same method I call multiple GraphQL service endpoints using the HttpClient instance that was resolved at the beginning of the method. However, during the second call I encounter the error "Cannot access a disposed object."
Is there a recommended or best practice for handling dynamically changing GraphQL endpoints in StrawberryShake without running into HttpClient disposal issues?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions