@envelop/graphql-modules 3.4.0 → 3.4.1-alpha-72027859.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,20 +13,22 @@ yarn add @envelop/graphql-modules
|
|
|
13
13
|
## Usage Example
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
import { envelop } from '@envelop/core'
|
|
17
|
-
import { createApplication } from 'graphql-modules'
|
|
18
|
-
import { useGraphQLModules } from '@envelop/graphql-modules'
|
|
16
|
+
import { envelop } from '@envelop/core'
|
|
17
|
+
import { createApplication } from 'graphql-modules'
|
|
18
|
+
import { useGraphQLModules } from '@envelop/graphql-modules'
|
|
19
19
|
|
|
20
20
|
const myApp = createApplication({
|
|
21
|
-
modules: [
|
|
21
|
+
modules: [
|
|
22
|
+
/* ... */
|
|
23
|
+
]
|
|
22
24
|
})
|
|
23
25
|
|
|
24
26
|
const getEnveloped = envelop({
|
|
25
27
|
plugins: [
|
|
26
28
|
// ... other plugins ...
|
|
27
|
-
useGraphQLModules(myApp)
|
|
28
|
-
]
|
|
29
|
-
})
|
|
29
|
+
useGraphQLModules(myApp)
|
|
30
|
+
]
|
|
31
|
+
})
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
Then, you can use GraphQL-Modules `injector` in your resolvers:
|
|
@@ -35,7 +37,7 @@ Then, you can use GraphQL-Modules `injector` in your resolvers:
|
|
|
35
37
|
const resolvers = {
|
|
36
38
|
Query: {
|
|
37
39
|
foo: (root, args, context, info) => {
|
|
38
|
-
const myProviderInstance = context.injector.get(...)
|
|
40
|
+
const myProviderInstance = context.injector.get(/* ... */)
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/graphql-modules",
|
|
3
|
-
"version": "3.4.0",
|
|
3
|
+
"version": "3.4.1-alpha-72027859.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "
|
|
6
|
+
"@envelop/core": "2.4.1-alpha-72027859.0",
|
|
7
7
|
"graphql-modules": "^1 || ^2.0.0",
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|