INNER CODE UNIT · TypeScript
getGraphQLInsertTypeNested
OS-Guild/graphql-to-mongodb · src/graphQLInsertType.ts:28
function getGraphQLInsertTypeNested(
type: GraphQLScalarType | GraphQLEnumType | GraphQLNonNull<any> | GraphQLObjectType | GraphQLList<any>,
...excludedFields: string[]) : GraphQLInputType {
if (type instanceof GraphQLScalarType ||
type instanceof GraphQLEnumType) {
return type;
}
if (type instanceof GraphQLNonNull) {
return new GraphQLNonNull(getGraphQLInsertTypeNested(type.ofType));
}
if (type instanceof GraphQLList) {
return new GraphQLList(getGraphQLInsertTypeNested(type.ofType));
}
const inputTypeName = setSuffix(type.name, 'Type', 'InsertType');