Trying to get back a list of IdTypes from a graphQL query. Currently using introspection to get the list, however after a security audit we have been advised to disable introspection.
This is what I've currently got and obviously it doesn't work :(
import mongoose from 'mongoose'
import { GQC } from 'graphql-compose';
import { composeWithMongoose } from 'graphql-compose-mongoose';
export const IdTypeSchema = new mongoose.Schema({
idType: {
type: String,
enum: ['ID', 'Passport', 'None']
}
})
const IdType = mongoose.model('IdType', IdTypeSchema)
export const IdTypeTC = composeWithMongoose(IdType, {})
GQC.rootQuery().addFields({
idTypesMany: IdTypeTC.getResolver('findMany')
})
The enums are unlikely to change often.
I didn't solve this - but here's what worked :D Didn't need to involve mongoose at all...