@envelop/apollo-federation 2.4.0-alpha-22f3089.0 → 2.4.1-alpha-4f69056d.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
CHANGED
|
@@ -11,27 +11,27 @@ yarn add @envelop/apollo-federation
|
|
|
11
11
|
## Usage Example
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
import { envelop } from '@envelop/core'
|
|
15
|
-
import { ApolloGateway } from '@apollo/gateway'
|
|
16
|
-
import { useApolloFederation } from '@envelop/apollo-federation'
|
|
14
|
+
import { envelop } from '@envelop/core'
|
|
15
|
+
import { ApolloGateway } from '@apollo/gateway'
|
|
16
|
+
import { useApolloFederation } from '@envelop/apollo-federation'
|
|
17
17
|
|
|
18
18
|
// Initialize the gateway
|
|
19
19
|
const gateway = new ApolloGateway({
|
|
20
20
|
serviceList: [
|
|
21
21
|
{ name: 'accounts', url: 'http://localhost:4001' },
|
|
22
|
-
{ name: 'products', url: 'http://localhost:4002' }
|
|
22
|
+
{ name: 'products', url: 'http://localhost:4002' }
|
|
23
23
|
// ...additional subgraphs...
|
|
24
|
-
]
|
|
25
|
-
})
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
26
|
|
|
27
27
|
// Make sure all services are loaded
|
|
28
|
-
await gateway.load()
|
|
28
|
+
await gateway.load()
|
|
29
29
|
|
|
30
30
|
// Then pass it to the plugin configuration
|
|
31
31
|
const getEnveloped = envelop({
|
|
32
32
|
plugins: [
|
|
33
33
|
// ... other plugins ...
|
|
34
|
-
useApolloFederation({ gateway })
|
|
35
|
-
]
|
|
36
|
-
})
|
|
34
|
+
useApolloFederation({ gateway })
|
|
35
|
+
]
|
|
36
|
+
})
|
|
37
37
|
```
|
package/cjs/index.js
CHANGED
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useApolloFederation = void 0;
|
|
4
4
|
const graphql_1 = require("graphql");
|
|
5
5
|
const apollo_server_caching_1 = require("apollo-server-caching");
|
|
6
|
-
const
|
|
6
|
+
const new_cache_policy_js_1 = require("./new-cache-policy.js");
|
|
7
7
|
const useApolloFederation = (options) => {
|
|
8
|
-
const { gateway, cache = new apollo_server_caching_1.InMemoryLRUCache(), logger = console, metrics = Object.create(null), overallCachePolicy = (0,
|
|
8
|
+
const { gateway, cache = new apollo_server_caching_1.InMemoryLRUCache(), logger = console, metrics = Object.create(null), overallCachePolicy = (0, new_cache_policy_js_1.newCachePolicy)(), } = options;
|
|
9
9
|
let schemaHash;
|
|
10
10
|
const documentSourceMap = new WeakMap();
|
|
11
11
|
return {
|
|
File without changes
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getOperationAST, print, printSchema, Source } from 'graphql';
|
|
2
2
|
import { InMemoryLRUCache } from 'apollo-server-caching';
|
|
3
|
-
import { newCachePolicy } from './
|
|
3
|
+
import { newCachePolicy } from './new-cache-policy.js';
|
|
4
4
|
export const useApolloFederation = (options) => {
|
|
5
5
|
const { gateway, cache = new InMemoryLRUCache(), logger = console, metrics = Object.create(null), overallCachePolicy = newCachePolicy(), } = options;
|
|
6
6
|
let schemaHash;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/apollo-federation",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1-alpha-4f69056d.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.4.
|
|
6
|
+
"@envelop/core": "2.4.1-alpha-4f69056d.0",
|
|
7
7
|
"@apollo/gateway": "^0.41.0 || ^0.42.0 || ^0.43.0",
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|
|
File without changes
|