Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@envelop/graphql-modules

Package Overview
Dependencies
Maintainers
1
Versions
1800
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.

  • 6.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.6K
increased by37%
Maintainers
1
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 16 Oct 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc