Graph QLOperation
Annotation that declares a GraphQL executable document on a Kotlin singleton object.
Apply this annotation to a Kotlin object that extends QueryFromAnnotation or MutationFromAnnotation to define a GraphQL operation once and execute it via ctx.query / ctx.mutation within the same tenant module.
@GraphQLOperation("{ user(id: \$userId) { id ...UserCoreFields } }")
object GetUserQuery : QueryFromAnnotation()
@GraphQLOperation("mutation { sendMessage(input: \$input) { success } }")
object SendMessageMutation : MutationFromAnnotation()Content copied to clipboard
The annotated class must be a Kotlin singleton object. The document must contain exactly one operation. It may reference named fragments from the same module using spread syntax (...FragmentName), and variable declarations are validated against the schema at compile time.