useExtendContext
Easily extends the context with custom fields.
- Package
- @envelop/core
- Weekly downloads
- 5.5M
- Version
- 5.6.1
- License
- MIT
- Updated
- Sep 16, 2026
useExtendContext
Easily extends the context with custom fields.
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine, useExtendContext } from '@envelop/core'
const getEnveloped = envelop({
plugins: [
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
useExtendContext(async contextSoFar => {
return {
myCustomField: {
/* ... */
}
}
})
// ... other plugins ...
]
})