MCPcopy Create free account
hub / github.com/ardatan/graphql-tools / assertUnionTypeDefinitionNode

Function assertUnionTypeDefinitionNode

packages/testing/assertion.ts:82–89  ·  view source on GitHub ↗
(
  input: ASTNode,
)

Source from the content-addressed store, hash-verified

80 throw new Error(`Expected InterfaceTypeDefinitionNode. Got ${input.kind}`);
81}
82export function assertUnionTypeDefinitionNode(
83 input: ASTNode,
84): asserts input is UnionTypeDefinitionNode {
85 if (input.kind === 'UnionTypeDefinition') {
86 return;
87 }
88 throw new Error(`Expected InterfaceTypeDefinitionNode. Got ${input.kind}`);
89}
90export function assertNamedTypeNode(input: ASTNode): asserts input is NamedTypeNode {
91 if (input.kind === 'NamedType') {
92 return;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected