INNER CODE UNIT · TypeScript

getInnerType

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

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

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

    return innerType;
}

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;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…