-
-
Notifications
You must be signed in to change notification settings - Fork 912
refactor(metadata): no default graphql operation name #5348
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
Conversation
@@ -78,6 +78,7 @@ public function getItemQueryFields(string $resourceClass, Operation $operation, | |||
return []; | |||
} | |||
|
|||
// TODO: it'd be nice to get rid of this hard coded name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using instanceof
here?
|
||
if (!$useWrappedType) { | ||
$wrappedOperationName = $operation instanceof Query ? $operationName : 'item_query'; | ||
$wrappedOperation = $resourceMetadataCollection->getGraphQlOperation(null, forceCollection: $operation instanceof Query); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using a named argument here and not elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to start using them I can revert for the codestyle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I think it's better like this indeed. But you should uniformize the call.
->withClass($type->getClassName()) | ||
->withShortName($operation?->getShortName() ?? (new \ReflectionClass($type->getClassName()))->getShortName()) | ||
->withDescription($operation?->getDescription()); | ||
$enumOperation = new Query(name: 'item_query', class: $type->getClassName(), shortName: $operation?->getShortName() ?? (new \ReflectionClass($type->getClassName()))->getShortName(), description: $operation?->getDescription()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
is not necessary, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do need a name
@@ -115,7 +115,7 @@ class: $class, | |||
fetchPartial: $fetchPartial, | |||
forceEager: $forceEager, | |||
priority: $priority, | |||
name: $name ?: 'item_query', | |||
name: $name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we want to remove logic from our operations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, why not.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is done in #5657 |
No description provided.