Skip to main content

GraphQLIntersectionType

Intersection Type Definition

When a field can return one of a set of types constrained by multiple abstract types, an Intersection type is used to describe the constraints as well as providing a function to determine which type is actually used when the field is resolved.

Example:

const PetNodeType = new GraphQLIntersectionType({
name: 'Pet',
types: [ PetType, NodeType ],
resolveType(value) {
if (value instanceof Dog) {
return DogType;
}
if (value instanceof Cat) {
return CatType;
}
}
});

Index

Constructors

constructor

Properties

astNode

astNode: Maybe<IntersectionTypeDefinitionNode>

description

description: Maybe<string>

extensionASTNodes

extensionASTNodes: readonly IntersectionTypeExtensionNode[]

extensions

extensions: Readonly<GraphQLIntersectionTypeExtensions>

name

name: string

resolveType

resolveType: Maybe<GraphQLTypeResolver<any, any>>

Accessors

[toStringTag]

  • get [toStringTag](): string
  • Returns string

Methods

getTypes

toConfig

  • toConfig(): GraphQLIntersectionTypeNormalizedConfig
  • Returns GraphQLIntersectionTypeNormalizedConfig

toJSON

  • toJSON(): string
  • Returns string

toString

  • toString(): string
  • Returns string