Socket
Book a DemoInstallSign in
Socket

@envelop/graphql-modules

Package Overview
Dependencies
Maintainers
2
Versions
1935
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@envelop/graphql-modules

This plugins integrates [`graphql-modules`](https://github.com/Urigo/graphql-modules) execution lifecycle into the GraphQL execution flow.

Source
npmnpm
Version
8.0.0
Version published
Weekly downloads
10K
-32.68%
Maintainers
2
Weekly downloads
 
Created
Source

@envelop/graphql-modules

This plugins integrates graphql-modules execution lifecycle into the GraphQL execution flow.

If you are using graphql-modules dependency injection - this setup is needed in order to make sure Injector is created and destroyed at the right time.

Getting Started

yarn add @envelop/graphql-modules

Usage Example

import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { createApplication } from 'graphql-modules'
import { envelop, useEngine } from '@envelop/core'
import { useGraphQLModules } from '@envelop/graphql-modules'

const myApp = createApplication({
  modules: [
    /* ... */
  ]
})

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    // ... other plugins ...
    useGraphQLModules(myApp)
  ]
})

Then, you can use GraphQL-Modules injector in your resolvers:

const resolvers = {
  Query: {
    foo: (root, args, context, info) => {
      const myProviderInstance = context.injector.get(/* ... */)
    }
  }
}

FAQs

Package last updated on 20 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts