This plugins clean up the registered schema by removing unused and empty types.
yarn add @envelop/pruned-schema
See @graphql-tools/utils/pruneSchema for the list of available options.
import { execute, parse, subscribe, validate } from 'graphql'
import { envelop } from '@envelop/core'
import { usePrunedSchema } from '@envelop/response-cache'
const getEnveloped = envelop({
parse,
validate,
execute,
subscribe,
plugins: [
// ... other plugins ...
usePrunedSchema({
// pruneSchema options
})
]
})