import { schemaComposer as globalSchemaComposer } from 'graphql-compose' ; import type { Model } from 'mongoose' ; import { ComposeWithMongooseDiscriminatorsOpts , DiscriminatorTypeComposer } from './discriminators' ; export * from './discriminators' ; export function composeWithMongooseDiscriminators < TDoc , TContext = any > ( baseModel , opts ? ) { const sc = opts ?. schemaComposer || globalSchemaComposer ; return DiscriminatorTypeComposer . createFromModel ( baseModel , sc , opts ) ; }