@apollo/federation-internals
Advanced tools
Comparing version 2.0.0-preview.12 to 2.0.0-preview.13
# CHANGELOG for `@apollo/federation-internals` | ||
## v2.0.0-preview.13 | ||
- Released in sync with other federation packages but no changes to this package. | ||
## v2.0.0-preview.12 | ||
@@ -4,0 +8,0 @@ |
@@ -208,4 +208,15 @@ "use strict"; | ||
this.renameFederationTypes(); | ||
(0, federation_1.setSchemaAsFed2Subgraph)(this.schema); | ||
this.subgraph = new federation_1.Subgraph(originalSubgraph.name, originalSubgraph.url, this.schema); | ||
try { | ||
(0, federation_1.setSchemaAsFed2Subgraph)(this.schema); | ||
} | ||
catch (e) { | ||
const causes = (0, definitions_1.errorCauses)(e); | ||
if (causes) { | ||
causes.forEach((c) => this.addError(c)); | ||
} | ||
else { | ||
throw e; | ||
} | ||
} | ||
this.metadata = this.subgraph.metadata(); | ||
@@ -212,0 +223,0 @@ } |
{ | ||
"name": "@apollo/federation-internals", | ||
"version": "2.0.0-preview.12", | ||
"version": "2.0.0-preview.13", | ||
"description": "Apollo Federation internal utilities", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@apollo/core-schema": "^0.3", | ||
"@apollo/core-schema": "~0.2.3", | ||
"chalk": "^4.1.0", | ||
@@ -37,3 +37,3 @@ "js-levenshtein": "^1.1.6" | ||
}, | ||
"gitHead": "408012182a81d42c7a17abee200064af9205f393" | ||
"gitHead": "c0209dbd6ab3e96584a37b27ab1cd94d4634751e" | ||
} |
@@ -281,4 +281,24 @@ import { | ||
this.renameFederationTypes(); | ||
setSchemaAsFed2Subgraph(this.schema); | ||
// Setting this property before trying to switch the cloned schema to fed2 because on | ||
// errors `addError` uses `this.subgraph.name`. | ||
this.subgraph = new Subgraph(originalSubgraph.name, originalSubgraph.url, this.schema); | ||
try { | ||
setSchemaAsFed2Subgraph(this.schema); | ||
} catch (e) { | ||
// This could error out if some directive definition clashes with a federation one while | ||
// having an incompatible definition. Note that in that case, the choices for the user | ||
// are either: | ||
// 1. fix/remove the definition if they did meant the federation directive, just had an | ||
// invalid definition. | ||
// 2. but if they have their own directive whose name happens to clash with a federation | ||
// directive one but is genuinely a different directive, they will have to move their | ||
// schema to a fed2 one and use renaming. | ||
const causes = errorCauses(e); | ||
if (causes) { | ||
causes.forEach((c) => this.addError(c)); | ||
} else { | ||
// An unexpected exception, rethrow. | ||
throw e; | ||
} | ||
} | ||
this.metadata = this.subgraph.metadata(); | ||
@@ -285,0 +305,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28768
1712815
+ Added@apollo/core-schema@0.2.3(transitive)
- Removed@apollo/core-schema@0.3.0(transitive)
- Removed@protoplasm/recall@0.2.4(transitive)
Updated@apollo/core-schema@~0.2.3