Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(metadata): get graphql operation when available #4522

Merged
merged 1 commit into from Oct 25, 2021

Conversation

soyuka
Copy link
Member

@soyuka soyuka commented Oct 21, 2021

Removes the graphql_operation_name context. Simplifies the ResourceCollectionMetadata->getOperation() method which can return either an Operation either a Graphql\Operation metadata class.

@@ -38,20 +38,19 @@ public function __construct(ResourceMetadataCollectionFactoryInterface $resource

public function create(?string $resourceClass, string $operationName, array $resolverContext, bool $normalization): array
{
$context = ['resource_class' => $resourceClass, 'graphql_operation_name' => $operationName];
$context = ['resource_class' => $resourceClass, 'operation_name' => $operationName, 'graphql_operation_name' => $operationName];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need graphql_operation_name at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for compatibility but we can remove it in 3.x

@alanpoulain
Copy link
Member

Looks nice!

@soyuka soyuka merged commit 1a2ba1d into api-platform:main Oct 25, 2021
@soyuka soyuka deleted the perf/graphql-operation branch October 25, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants