Skip to content

Releases: brigade/graphql-code-generator

TypeScript template feature: generate full schema type

27 Nov 22:57

Choose a tag to compare

This adds a new schemaType option to the TypeScript template. When used, this option will add a type to the generated TypeScript code that represents the entirety of the input GraphQL schema's type system. Each type from the schema will be placed as a property on the interface and given its declared type.

The new interface is named Schema, optionally prefixed by the interfacePrefix option and placed within the optional schemaNamespace namespace.

This type is not generated by default. It is useful when the context of the schema as a whole is needed, such as when determining whether a GraphQL type name used in code is properly referencing a type that exists in a target GraphQL schema.