Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ lerna-debug.log
/demo/cmd/subscriptiontest/subscriptiontest
.github/scripts/keycloak-22.0.4/**
.github/scripts/keycloak-22.0.4.zip
/router-tests/cmd/config-validator/router-configs/**

# Go workspace files
go.work
Expand Down
540 changes: 279 additions & 261 deletions composition-go/index.global.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions composition-go/shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@
"dependencies": {
"@wundergraph/composition": "workspace:*",
"@wundergraph/cosmo-shared": "workspace:*",
"graphql": "catalog:"
"graphql": "catalog:",
"set.prototype.difference": "^1.1.7",
"set.prototype.intersection": "^1.1.8",
"set.prototype.isdisjointfrom": "^1.1.5",
"set.prototype.issubsetof": "^1.1.4",
"set.prototype.issupersetof": "^1.1.3"
},
"devDependencies": {
"@types/node": "catalog:",
"esbuild": "^0.25.0",
"esbuild-plugin-polyfill-node": "^0.3.0",
"tsup": "^8.0.1",
"tsup": "8.3.5",
"typescript": "catalog:"
}
}
15 changes: 13 additions & 2 deletions composition-go/shim/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import 'set.prototype.difference/auto';
import 'set.prototype.intersection/auto';
import 'set.prototype.isdisjointfrom/auto';
import 'set.prototype.issubsetof/auto';
import 'set.prototype.issupersetof/auto';
import {
federateSubgraphs as realFederateSubgraphs,
FieldConfiguration,
Expand Down Expand Up @@ -41,7 +46,10 @@ function createFederableSubgraph(subgraph: Subgraph) {
}

export function federateSubgraphs(subgraphs: Subgraph[]): FederatedGraph {
const result = realFederateSubgraphs({ subgraphs: subgraphs.map(createFederableSubgraph), version: LATEST_ROUTER_COMPATIBILITY_VERSION });
const result = realFederateSubgraphs({
subgraphs: subgraphs.map(createFederableSubgraph),
version: LATEST_ROUTER_COMPATIBILITY_VERSION,
});
if (!result.success) {
throw new Error(`could not federate schema: ${result.errors.map((e: Error) => e.message).join(', ')}`);
}
Expand All @@ -52,7 +60,10 @@ export function federateSubgraphs(subgraphs: Subgraph[]): FederatedGraph {
}

export function buildRouterConfiguration(subgraphs: Subgraph[]): string {
const result = realFederateSubgraphs({ subgraphs: subgraphs.map(createFederableSubgraph), version: LATEST_ROUTER_COMPATIBILITY_VERSION });
const result = realFederateSubgraphs({
subgraphs: subgraphs.map(createFederableSubgraph),
version: LATEST_ROUTER_COMPATIBILITY_VERSION,
});
if (!result.success) {
throw new Error(`could not federate schema: ${result.errors.map((e: Error) => e.message).join(', ')}`);
}
Expand Down
23 changes: 13 additions & 10 deletions composition-go/shim/src/polyfill.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
var self = globalThis;
var global = globalThis;

function BigInt(value) {
return value;
return value;
}

class URL {
constructor(url, base) {
// urlParse is provided by the runtime
const result = urlParse(url, base || '');
for (const prop in result) {
this[prop] = result[prop]
}
constructor(url, base) {
// urlParse is provided by the runtime
const result = urlParse(url, base || '');
for (const prop in result) {
this[prop] = result[prop];
}
}

static canParse(url, base = undefined) {
return urlCanParse(url, base || '');
}
static canParse(url, base = undefined) {
return urlCanParse(url, base || '');
}
}
1 change: 1 addition & 0 deletions composition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
},
"devDependencies": {
"@types/lodash": "catalog:",
"@types/node": "catalog:",
"@vitest/coverage-v8": "catalog:",
"del-cli": "catalog:",
"typescript": "catalog:",
Expand Down
Loading
Loading