Skip to content

Conversation

@jwaldrip
Copy link

Summary

This adds full TypeSystem directive support as requested in issue #1003.

Changes

  • Add applied_directives field to all Type structs (Object, Scalar, Field, Interface, Union, Enum, InputObject, Argument, Enum.Value)
  • Preserve applied directives through the build phase from Blueprint to final Type structs
  • Add __AppliedDirective and __DirectiveArgument introspection types
  • Add appliedDirectives field to __Type, __Field, __InputValue, and __EnumValue introspection types

Supported Locations

TypeSystem directives can be applied to all spec-defined locations:

  • SCHEMA, SCALAR, OBJECT, FIELD_DEFINITION, ARGUMENT_DEFINITION
  • INTERFACE, UNION, ENUM, ENUM_VALUE, INPUT_OBJECT, INPUT_FIELD_DEFINITION

The directive expand callback continues to work for transforming type definitions at compile time, and applied directives are now visible through introspection queries.

Example Introspection

{
  __type(name: "User") {
    appliedDirectives {
      name
      args {
        name
        value
      }
    }
  }
}

Closes #1003

Test plan

  • Added comprehensive TypeSystem directive tests (25 new tests)
  • All 1467 tests pass
  • Tested directive application on all type system elements
  • Verified introspection returns applied directives correctly

🤖 Generated with Claude Code

This adds full TypeSystem directive support as requested in issue absinthe-graphql#1003:

- Add `applied_directives` field to all Type structs (Object, Scalar,
  Field, Interface, Union, Enum, InputObject, Argument, Enum.Value)
- Preserve applied directives through the build phase from Blueprint
  to final Type structs
- Add `__AppliedDirective` and `__DirectiveArgument` introspection types
- Add `appliedDirectives` field to `__Type`, `__Field`, `__InputValue`,
  and `__EnumValue` introspection types
- TypeSystem directives can be applied to all spec-defined locations:
  SCHEMA, SCALAR, OBJECT, FIELD_DEFINITION, ARGUMENT_DEFINITION,
  INTERFACE, UNION, ENUM, ENUM_VALUE, INPUT_OBJECT, INPUT_FIELD_DEFINITION

The directive `expand` callback continues to work for transforming
type definitions at compile time, and applied directives are now
visible through introspection queries.

Closes absinthe-graphql#1003

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@jwaldrip jwaldrip force-pushed the feat/typesystem-directives branch from 5d8f1f5 to ccfd7c7 Compare January 13, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support TypeSystem Directives

1 participant