Skip to content

Add directives and description to supermassive ast#627

Open
vejrj wants to merge 23 commits intomainfrom
users/jvejr/add-directives-to-supermassive-ast
Open

Add directives and description to supermassive ast#627
vejrj wants to merge 23 commits intomainfrom
users/jvejr/add-directives-to-supermassive-ast

Conversation

@vejrj
Copy link
Copy Markdown
Contributor

@vejrj vejrj commented Jan 16, 2026

This pull request introduces support for descriptions and directives metadata on GraphQL types, fields, enums, and directives in the @graphitation/supermassive library and its codegen preset. These changes add new metadata fields to the internal schema representation, update utility functions for handling this metadata, and expand test coverage to ensure correct encoding and decoding of descriptions and directives.

Schema Metadata Enhancements:

  • Added support for descriptions and directives metadata to all GraphQL type definition tuples (scalars, objects, interfaces, unions, enums, input objects), fields, and directive definitions via new metadata fields and types such as TypeDefinitionMetadata, EnumTypeDefinitionMetadata, and DirectiveDefinitionMetadata. [1] [2] [3]
  • Updated schema utility functions to get/set metadata for types, fields, enums, and directives, and to handle these new metadata fields throughout the schema definition code. [1] [2] [3] [4]

API and Utility Updates:

  • Added and updated functions such as getTypeDefinitionMetadata, getObjectTypeMetadata, getEnumMetadata, getDirectiveDefinitionMetadata, and others to access the new metadata fields. [1] [2] [3]
  • Adjusted the handling of directive names and locations to distinguish between directive tuples and directive definition tuples. [1] [2] [3] [4]

Codegen and Integration:

  • Updated @graphitation/graphql-codegen-near-operation-file-preset-with-resolver-metadata to leverage the new metadata, including changes to how interfaces are handled in resolver metadata extraction. [1] [2] [3] [4]
  • Published appropriate change files for both @graphitation/supermassive (minor) and the codegen preset (patch), noting the addition of enum value descriptions and directives. [1] [2]

Testing Improvements:

  • Expanded test coverage in decodeASTSchema.test.ts to verify correct encoding and decoding of descriptions and directives, including new inline snapshots and additional test cases for schemas with descriptions and directives. [1] [2] [3]

These changes lay the groundwork for richer schema introspection and improved code generation by preserving and exposing more detailed metadata throughout the schema lifecycle.

@vejrj vejrj force-pushed the users/jvejr/add-directives-to-supermassive-ast branch 3 times, most recently from d1e286a to 75a1ece Compare January 16, 2026 09:50
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 16, 2026

📊 Benchmark Analysis Report

No significant performance changes detected


Threshold: 5% change


Updated: 2026-01-16T09:56:49.761Z

@vejrj vejrj force-pushed the users/jvejr/add-directives-to-supermassive-ast branch from ef3c25c to b84ac8e Compare January 22, 2026 14:47
@vejrj vejrj force-pushed the users/jvejr/add-directives-to-supermassive-ast branch from b84ac8e to 587585c Compare March 19, 2026 09:29
@vejrj vejrj marked this pull request as ready for review April 12, 2026 14:26
@vejrj vejrj requested a review from vladar April 12, 2026 14:26
@vejrj vejrj requested a review from vladar April 14, 2026 10:38
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.

2 participants