ChilliCream / ChilliCream/graphql-platform
Generated ClientServiceProvider (Singleton) gets the IServiceProvider (Scoped) injected
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Product
Strawberry Shake
Version
15.1.11
Link to minimal reproduction
You can see the problem in every generated client.
Steps to reproduce
Generate a client with Strawberry Shake.
What is expected?
Correct lifetimes of generated classes.
What is actually happening?
We have an internal validation to check the lifetime of registered classes in the ioc container at runtime (in dev environment), which fails when checking the generated classes of Strawberry Shake:
The generated ClientServiceProvider (singleton) gets the IServiceProvider (scoped) injected, which could be problematic when the ioc container disposes the IServiceProvider.
Is my assumption correct?
Relevant log output
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by generating a Strawberry Shake client and inspect the generated ClientServiceProvider and its dependency-injection registrations. Confirm how IServiceProvider is injected and determine whether the generated singleton captures a scoped service; done means the generated lifetimes satisfy the repository's runtime validation without this warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100