yarn add @envelop/core
pnpm add @envelop/core
npm install @envelop/core
useExtendContext
#Easily extends the context with custom fields.
import { envelop, useExtendContext } from '@envelop/core'
import { buildSchema } from 'graphql'
const getEnveloped = envelop({
plugins: [
useExtendContext(async contextSoFar => {
return {
myCustomField: {
/* ... */
}
}
})
// ... other plugins ...
]
})