@envelop/graphql-modules 3.4.0-alpha-c0cc559.0 → 3.4.0-alpha-e9434aa.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/{index.js → cjs/index.js} +3 -5
- package/cjs/package.json +1 -0
- package/{index.mjs → esm/index.js} +4 -2
- package/package.json +36 -14
- package/{index.d.ts → typings/index.d.ts} +0 -0
- package/README.md +0 -42
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGraphQLModules = void 0;
|
|
5
4
|
const graphqlModulesControllerSymbol = Symbol('GRAPHQL_MODULES');
|
|
6
5
|
const useGraphQLModules = (app) => {
|
|
7
6
|
return {
|
|
@@ -30,5 +29,4 @@ const useGraphQLModules = (app) => {
|
|
|
30
29
|
},
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
|
-
|
|
34
32
|
exports.useGraphQLModules = useGraphQLModules;
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGraphQLModules = void 0;
|
|
1
4
|
const graphqlModulesControllerSymbol = Symbol('GRAPHQL_MODULES');
|
|
2
5
|
const useGraphQLModules = (app) => {
|
|
3
6
|
return {
|
|
@@ -26,5 +29,4 @@ const useGraphQLModules = (app) => {
|
|
|
26
29
|
},
|
|
27
30
|
};
|
|
28
31
|
};
|
|
29
|
-
|
|
30
|
-
export { useGraphQLModules };
|
|
32
|
+
exports.useGraphQLModules = useGraphQLModules;
|
package/package.json
CHANGED
|
@@ -1,34 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/graphql-modules",
|
|
3
|
-
"version": "3.4.0-alpha-
|
|
3
|
+
"version": "3.4.0-alpha-e9434aa.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.4.0-alpha-
|
|
7
|
-
"graphql": "^
|
|
8
|
-
"graphql
|
|
6
|
+
"@envelop/core": "2.4.0-alpha-e9434aa.0",
|
|
7
|
+
"graphql-modules": "^1 || ^2.0.0",
|
|
8
|
+
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|
|
10
|
+
"dependencies": {},
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/
|
|
13
|
+
"url": "https://github.com/n1ru4l/envelop.git",
|
|
13
14
|
"directory": "packages/plugins/graphql-modules"
|
|
14
15
|
},
|
|
15
16
|
"author": "Dotan Simha <dotansimha@gmail.com>",
|
|
16
17
|
"license": "MIT",
|
|
17
|
-
"main": "index.js",
|
|
18
|
-
"module": "index.
|
|
19
|
-
"typings": "index.d.ts",
|
|
18
|
+
"main": "cjs/index.js",
|
|
19
|
+
"module": "esm/index.js",
|
|
20
|
+
"typings": "typings/index.d.ts",
|
|
20
21
|
"typescript": {
|
|
21
|
-
"definition": "index.d.ts"
|
|
22
|
+
"definition": "typings/index.d.ts"
|
|
22
23
|
},
|
|
24
|
+
"type": "module",
|
|
23
25
|
"exports": {
|
|
24
26
|
".": {
|
|
25
|
-
"require":
|
|
26
|
-
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./typings/index.d.ts",
|
|
29
|
+
"default": "./cjs/index.js"
|
|
30
|
+
},
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./typings/index.d.ts",
|
|
33
|
+
"default": "./esm/index.js"
|
|
34
|
+
},
|
|
35
|
+
"default": {
|
|
36
|
+
"types": "./typings/index.d.ts",
|
|
37
|
+
"default": "./esm/index.js"
|
|
38
|
+
}
|
|
27
39
|
},
|
|
28
40
|
"./*": {
|
|
29
|
-
"require":
|
|
30
|
-
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./typings/*.d.ts",
|
|
43
|
+
"default": "./cjs/*.js"
|
|
44
|
+
},
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./typings/*.d.ts",
|
|
47
|
+
"default": "./esm/*.js"
|
|
48
|
+
},
|
|
49
|
+
"default": {
|
|
50
|
+
"types": "./typings/*.d.ts",
|
|
51
|
+
"default": "./esm/*.js"
|
|
52
|
+
}
|
|
31
53
|
},
|
|
32
54
|
"./package.json": "./package.json"
|
|
33
55
|
}
|
|
34
|
-
}
|
|
56
|
+
}
|
|
File without changes
|
package/README.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
## `@envelop/graphql-modules`
|
|
2
|
-
|
|
3
|
-
This plugins integrates [`graphql-modules`](https://github.com/Urigo/graphql-modules) execution lifecycle into the GraphQL execution flow.
|
|
4
|
-
|
|
5
|
-
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.
|
|
6
|
-
|
|
7
|
-
## Getting Started
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
yarn add @envelop/graphql-modules
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage Example
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { envelop } from '@envelop/core';
|
|
17
|
-
import { createApplication } from 'graphql-modules';
|
|
18
|
-
import { useGraphQLModules } from '@envelop/graphql-modules';
|
|
19
|
-
|
|
20
|
-
const myApp = createApplication({
|
|
21
|
-
modules: [ ... ]
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const getEnveloped = envelop({
|
|
25
|
-
plugins: [
|
|
26
|
-
// ... other plugins ...
|
|
27
|
-
useGraphQLModules(myApp),
|
|
28
|
-
],
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Then, you can use GraphQL-Modules `injector` in your resolvers:
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
const resolvers = {
|
|
36
|
-
Query: {
|
|
37
|
-
foo: (root, args, context, info) => {
|
|
38
|
-
const myProviderInstance = context.injector.get(...);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
```
|