ListComposer
Getters
List
List: ListComposer<ListComposer<T>>;
Get Type wrapped in List modifier
const UserTC = schemaComposer.createObjectTC(`type User { name: String }`);
schemaComposer.Query.addFields({
users1: { type: UserTC.List }, // in SDL: users1: [User]
users2: { type: UserTC.NonNull.List }, // in SDL: users2: [User!]
users3: { type: UserTC.NonNull.List.NonNull } // in SDL: users2: [User!]!
});
NonNull
NonNull: NonNullComposer<ListComposer<T>>;
Get Type wrapped in NonNull modifier
const UserTC = schemaComposer.createObjectTC(`type User { name: String }`);
schemaComposer.Query.addFields({
users1: { type: UserTC.List }, // in SDL: users1: [User]
users2: { type: UserTC.NonNull.List }, // in SDL: users2: [User!]!
users3: { type: UserTC.NonNull.List.NonNull } // in SDL: users2: [User!]!
});
Properties
ofType
ofType: T;
Methods
getType()
getType(): GraphQLList<any>
getTypeName()
getTypeName(): string
getUnwrappedTC()
getUnwrappedTC(): NamedTypeComposer<any>
getTypePlural()
getTypePlural(): ListComposer<ListComposer<T>>
getTypeNonNull()
getTypeNonNull(): NonNullComposer<ListComposer<T>>
cloneTo()
cloneTo(
anotherSchemaComposer: SchemaComposer<any>,
cloneMap: Map<any, any>
): ListComposer<AnyTypeComposer<any>>
Clone this type to another SchemaComposer. Also will be cloned all wrapped types.