Skip to main content
class GraphQLNonNull
import { GraphQLNonNull } from "https://deno.land/x/kilatgraphql@16.6.0/mod.ts";

Non-Null Type Wrapper

A non-null is a wrapping type which points to another type. Non-null types enforce that their values are never null and can ensure an error is raised if this ever occurs during a request. It is useful for fields which you can make a strong guarantee on non-nullability, for example usually the id field of a database row will never be null.

Example:

const RowType = new GraphQLObjectType({
  name: 'Row',
  fields: () => ({
    id: { type: new GraphQLNonNull(GraphQLString) },
  })
})

Note: the enforcement of non-nullability occurs within the executor.

Constructors

new
GraphQLNonNull(ofType: T)

Properties

readonly
ofType: T
readonly
[Symbol.toStringTag]: string

Methods

toJSON(): string
toString(): string