Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

GraphQLNonNull

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.

class GraphQLNonNull<T extends GraphQLNullableType> {
constructor(ofType: T);
readonly ofType: T;
get [Symbol.toStringTag](): string;
 
toJSON(): string;
toString(): string;
}

§Type Parameters

§Constructors

§
new GraphQLNonNull(ofType: T)
[src]

§Properties

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

§Methods

§
toJSON(): string
[src]
§
toString(): string
[src]