Skip to main content

Custom directives

@Directive registers a directive definition; its arguments are derived from the class’s type hints. Apply it to types, fields, or arguments with AppliedDirective, whose locations and argument types are validated at build time and rendered in the SDL.

Field visibility

Field(private=True) keeps a Python attribute off the GraphQL schema (still readable by resolvers); Field(external=True) marks a field as federation-@external.

Enum customization

enum_value sets a member’s GraphQL name, description, or deprecation.