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

Make resolvers inherit description from superclass #5195

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

rmosolgo
Copy link
Owner

Oops -- I think this was just an oversight that description wasn't passed down to children.

Verified

This commit was signed with the committer’s verified signature.
drazisil-codecov Joe Becher
@rmosolgo rmosolgo added this to the 2.4.9 milestone Dec 26, 2024
@rmosolgo rmosolgo merged commit ca9ff0e into master Dec 27, 2024
14 of 15 checks passed
@rmosolgo rmosolgo deleted the resolver-inherit-description branch December 27, 2024 15:36
@@ -22,6 +22,7 @@ class Resolver
include Schema::Member::GraphQLTypeNames
# Really we only need description & comment from here, but:
extend Schema::Member::BaseDSLMethods
extend Member::BaseDSLMethods::ConfigurationExtension
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a side-effect from this change where resolvers that inherit from other resolvers must now explicitly declare a typename, otherwise they inherit the parent's typename and become a duplicate definition name.

Was this intentional? It's a bit counter-intuitive to the default precedent of elements following their class names.

Copy link
Owner Author

Choose a reason for hiding this comment

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

No, that was an accident. I've proposed a fix here: #5260

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, @swalkinshaw and I talked about the new behavior and agreed that it isn’t all bad. A resolver is effectively a representation of a Type, and type inheritance is generally discouraged in favor of sharing behavior through mixins. That’s internal precedent though. The former behavior is probably more consistent with the general library.

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