graphql-dotnet/conventions

Alias concurrency issue

shoe-diamente opened this issue · 1 comments

It appears that in a query like:

{
    abc {
        alias1: someField(...) { ... }
        alias2: someField(...) { ... }
    }
}

where the field is defined as:

        public async Task<T> SomeField(
            [Inject] DbContext dbContext,
            FilterInput input)
        {
            ...
        }

the same DbContext instance is injected in. Even though DbContext has a transient lifetime.
I would expect DbContext to be injected twice: once for each alias call.

Is this intended behaviour?

tlil commented

Yes. Also, closing as dup of #133 :)