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

[Scala 3] Add annotation to derive all case class methods as graphql fields #2306

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

kyri-petrou
Copy link
Collaborator

This PR adds the @GQLMethodsAsFields annotation that can be used to decorate a case class / case object to have all its public methods derived as fields (unless a method is annotated with @GQLExcluded.

We could potentially reuse the @GQLField annotation, although after staring at it for too long it really didn't make sense to me. I think we should be quite explicit and make it very clear to the user when looking at a case class definition that the public methods are going to be derived as fields. Let me know what you think @ghostdogpr!

/cc @paulpdaniels since I know you're migrating service(s) to Scala 3 you might be interested in this

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

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

Awesome!

I hate to be that guy but can you make a documentation PR? 😄

@kyri-petrou
Copy link
Collaborator Author

can you make a documentation PR? 😄

Is it too late to close this PR? 🥲

@kyri-petrou kyri-petrou merged commit 9d83c72 into series/2.x Jun 25, 2024
10 checks passed
@kyri-petrou kyri-petrou deleted the derive-all-methods-as-fields branch June 25, 2024 21:57
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.

2 participants