Skip to content

feat: support custom directives #134

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

Merged
merged 9 commits into from
May 23, 2025
Merged

feat: support custom directives #134

merged 9 commits into from
May 23, 2025

Conversation

danadajian
Copy link
Collaborator

@danadajian danadajian commented May 22, 2025

📝 Description

  • Adds support for generating @GraphQLDirective annotation classes for custom directives specified via config.
  • Argument support can be added later

@danadajian danadajian requested a review from a team as a code owner May 22, 2025 19:38
@danadajian danadajian changed the title feat: generate custom Kotlin directives by default feat: support custom directives May 23, 2025
@danadajian danadajian force-pushed the support-custom-directives branch from ffd0eb6 to acddaed Compare May 23, 2025 13:50
return `@GraphQLDirective(
name = "${titleCase(directiveName)}",
description = "${node.description?.value ?? ""}",
locations = [${node.locations.map((location) => `graphql.introspection.Introspection.DirectiveLocation.${location.value}`).join(", ")}]

Choose a reason for hiding this comment

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

it doesn't really matter all that much, but why inline the imports?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just easier than manually adding the imports to the top of the file which would require adding them to the extraImports config

@danadajian danadajian merged commit 0b109a9 into main May 23, 2025
1 check passed
@danadajian danadajian deleted the support-custom-directives branch May 23, 2025 14:24
Copy link

🎉 This PR is included in version 3.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants