Skip to content

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
@github-actions
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.

3 participants