• Solutions
  • Ecosystem
  • Blog
  • Our Services
  • About Us
  • Contact Us

GraphQL Envelop

Develop and share plugins that are usable with any GraphQL server framework or schema

PluginsGitHubGitHub
    • v3
      • Introduction
      • First Steps
      • Integrations and Examples
      • @envelop/core
      • Sharing Envelops
      • Tracing
      • Plugins
        • Introduction
        • Building Plugins
        • Lifecycle
        • Testing
        • TypeScript Support
      • Guides
        • Migrating from v2 to v3
        • Securing Your GraphQL API
        • Adding Authentication with Auth0
        • Monitoring and Tracing
        • Using GraphQL Features from the Future
        • Resolving Subscription DataLoader Caching Issues
        • Adding a GraphQL Response Cache
        • Integrating with Databases
    • v2
      • Introduction
      • First Steps
      • Integrations and Examples
      • @envelop/core
      • Sharing Envelops
      • Tracing
      • Plugins
        • Introduction
        • Building Plugins
        • Lifecycle
        • Testing
        • TypeScript Support
      • Guides
        • Securing Your GraphQL API
        • Adding Authentication with Auth0
        • Monitoring and Tracing
        • Using GraphQL Features from the Future
        • Resolving Subscription DataLoader Caching Issues
        • Adding a GraphQL Response Cache
        • Integrating with Databases
    • Plugins
    Question? Give us feedback →Edit this page
    • Plugins
    • Plugin

    useExtendContext

    Package nameWeekly DownloadsVersionLicenseUpdated
    @envelop/coreDownloadsVersionLicenseNov 24th, 2022

    useExtendContext

    Easily extends the context with custom fields.

    import { envelop, useEngine, useExtendContext } from '@envelop/core'
    import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
     
    const getEnveloped = envelop({
      plugins: [
        useEngine({ parse, validate, specifiedRules, execute, subscribe }),
        useExtendContext(async contextSoFar => {
          return {
            myCustomField: {
              /* ... */
            }
          }
        })
        // ... other plugins ...
      ]
    })
    Integrating with Databases

    PRODUCTS

    • Hive
    • Yoga
    • Envelop
    • Inspector
    • Code Generator
    • Mesh
    • Tools
    • Modules
    • ESLint
    • Config
    • Scalars
    • Helix
    • Shield
    • Swift
    • CLI
    • SOFA
    • Stencil
    • Angular
    • WhatsApp
    • KitQL

    RESOURCES

    • Press Kit

    COMPANY

    • About
    • Blog
    • Newsletter
    • Open Source
    • Services
    • GitHub

    COMMUNITY

    • Twitter
    • LinkedIn
    • Discord
    • Medium
    • YouTube
    Cloud Security Alliance Star Level One Badge