guard
Custom GraphQL type guards and property guards.
executableDirectiveLocation()β
function executableDirectiveLocation(directive): boolean
Defined in: packages/graphql/src/guard.ts:104
Checks if a directive is executable (related to operations).
Parametersβ
directiveβ
GraphQLDirective
Returnsβ
boolean
instanceOf()β
function instanceOf<T>(obj, type): obj is () => T
Defined in: packages/graphql/src/guard.ts:58
Checks if a GraphQL named type is of generic type T
.
Type Parametersβ
Tβ
T
a GraphQL type to check against, eg GraphQLObjectType
.
Parametersβ
objβ
unknown
a GraphQL named type from the GraphQL schema.
typeβ
() => T
the GraphQL type T
.
Returnsβ
obj is () => T
isApiType()β
function isApiType(type): boolean
Defined in: packages/graphql/src/guard.ts:140
Checks if a type belongs to API (operation related).
Parametersβ
typeβ
unknown
a GraphQL type.
Returnsβ
boolean
isDeprecated()β
function isDeprecated<T>(obj): obj is DeprecatedType<T>
Defined in: packages/graphql/src/guard.ts:79
Checks if a GraphQL named type is deprecated.
Type Parametersβ
Tβ
T
a GraphQL type to check against, eg GraphQLObjectType
.
Parametersβ
objβ
T
an instance of T
.
Returnsβ
obj is DeprecatedType<T>
isGraphQLFieldType()β
function isGraphQLFieldType(type): type is GraphQLField<unknown, unknown, unknown>
Defined in: packages/graphql/src/guard.ts:39
Checks if a GraphQL named type is of type GraphQLField
.
Parametersβ
typeβ
unknown
a GraphQL type.
Returnsβ
type is GraphQLField<unknown, unknown, unknown>
isOperation()β
function isOperation(type): type is GraphQLOperationType
Defined in: packages/graphql/src/guard.ts:94
Checks if a GraphQL type a GraphQL operation (query, mutation, subscription).
Parametersβ
typeβ
unknown
a GraphQL type.
Returnsβ
type is GraphQLOperationType
isSystemType()β
function isSystemType(type): boolean
Defined in: packages/graphql/src/guard.ts:153
Checks if a type belongs to schema (schema type definition excluding operations related types).
Parametersβ
typeβ
unknown
a GraphQL type.
Returnsβ
boolean
typeSystemDirectiveLocation()β
function typeSystemDirectiveLocation(directive): boolean
Defined in: packages/graphql/src/guard.ts:127
Checks if a directive is system (related to schema definition).
Parametersβ
directiveβ
GraphQLDirective
Returnsβ
boolean