Graph QLFragment
Annotation that declares a named GraphQL fragment on a Kotlin singleton object.
Apply this annotation to a Kotlin object that extends FragmentFromAnnotation to define a reusable GraphQL fragment and spread it (...MyFragment) in resolver fragments and ctx.query/ctx.mutation calls within the same tenant module.
@GraphQLFragment("""
fragment UserCoreFields on User {
id
name
email
}
""")
object UserCoreFieldsFragment : FragmentFromAnnotation<User>()Content copied to clipboard
The annotated class must be a Kotlin singleton object. The fragment text must contain exactly one fragment definition. Named fragments are scoped to the tenant module in which they are declared — spreading a fragment from a different module is a compile error.