Skip to content

Eager loading extension doesn't allow change context dynamically #2157

Open
@CvekCoding

Description

@CvekCoding

In my graphql-based application I would like to change normalization context dynamically while EagerLoadingExtension builds query. E.g. i want to have different Groups for different queries (I can distinguish between them by request names).

As I see, you deliberately skip the place where I could connect my ContextBuilder and change the context (I already have Groups and Attributes in my entity):

if (!isset($context['groups']) && !isset($context['attributes'])) {
$contextType = isset($context['api_denormalize']) ? 'denormalization_context' : 'normalization_context';
$context += $this->getNormalizationContext($context['resource_class'] ?? $resourceClass, $contextType, $options);
}

Why is this done? Or did I choose the wrong way to solve my problem?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions