INNER CODE UNIT · TypeScript
GraphQLInputObjectType
OS-Guild/graphql-to-mongodb · src/graphQLInsertType.ts:8
return cache(typesCache, inputTypeName, () => new GraphQLInputObjectType({
name: inputTypeName,
fields: getGraphQLInsertTypeFields(graphQLType, ...excludedFields)
}));
}
function getGraphQLInsertTypeFields(graphQLType: GraphQLObjectType, ...excludedFields: string[]) : () => FieldMap<GraphQLInputType> {
return () => {
const fields = getUnresolvedFieldsTypes(graphQLType, getGraphQLInsertTypeNested, ...excludedFields)();
const idField = fields['_id'];
if (idField && idField.type instanceof GraphQLNonNull) {
idField.type = idField.type.ofType;
}
return fields;
};