INNER CODE UNIT · TypeScript

isListField

OS-Guild/graphql-to-mongodb · src/common.ts:108

export function isListField(graphQLType: GraphQLType): boolean {
    let innerType = graphQLType;

    while (innerType instanceof GraphQLList
        || innerType instanceof GraphQLNonNull) {
        if (innerType instanceof GraphQLList) return true;
        innerType = innerType.ofType;
    }

    return false;
}

export function isNonNullField(graphQLType: GraphQLType): boolean {
    let innerType = graphQLType;

    while (innerType instanceof GraphQLList
        || innerType instanceof GraphQLNonNull) {
        if (innerType instanceof GraphQLNonNull) return true;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…