6.0.0 • Published 7 months ago

@envelop/graphql-modules v6.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@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(/* ... */)
    }
  }
}
6.0.0

7 months ago

5.0.3

8 months ago

5.0.2

8 months ago

5.0.1

8 months ago

4.0.5

1 year ago

4.0.6

1 year ago

5.0.0

12 months ago

4.0.4

1 year ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

3.6.0

2 years ago

3.5.0

2 years ago

3.4.0

2 years ago

3.4.2

2 years ago

3.4.1

2 years ago

3.3.3

2 years ago

3.3.2

2 years ago

3.3.1

2 years ago

3.3.0

2 years ago

3.2.0

2 years ago

2.0.0

2 years ago

3.0.0

2 years ago

3.1.0

2 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago