-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
653b5ee
commit 7e76dce
Showing
6 changed files
with
101 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
packages/graphql-mesh/patches/@omnigraph+json-schema+0.97.4.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
diff --git a/node_modules/@omnigraph/json-schema/cjs/addRootFieldResolver.js b/node_modules/@omnigraph/json-schema/cjs/addRootFieldResolver.js | ||
index 8006747..dfc6825 100644 | ||
old mode 100644 | ||
new mode 100755 | ||
index 8006747..f2af17c | ||
--- a/node_modules/@omnigraph/json-schema/cjs/addRootFieldResolver.js | ||
+++ b/node_modules/@omnigraph/json-schema/cjs/addRootFieldResolver.js | ||
@@ -35,6 +35,23 @@ function addHTTPRootFieldResolver(schema, field, logger, globalFetch, { path, op | ||
@@ -35,6 +35,21 @@ function addHTTPRootFieldResolver(schema, field, logger, globalFetch, { path, op | ||
const interpolatedBaseUrl = string_interpolation_1.stringInterpolator.parse(endpoint, interpolationData); | ||
const interpolatedPath = string_interpolation_1.stringInterpolator.parse(path, interpolationData); | ||
let fullPath = (0, url_join_1.default)(interpolatedBaseUrl, interpolatedPath); | ||
+ let subPath; | ||
+ /** | ||
+ * FIXME: This is a hack to follow link in the response | ||
+ * In case where the root object contains several links, | ||
+ * we need to follow the correct link which match the index of field in the path | ||
+ */ | ||
+ if (root && root?.followsLink?.length) { | ||
+ | ||
+ // HANDLE HATEOAS LINKS | ||
+ if (root && root?.followLinks?.length) { | ||
+ const index = info?.path?.key?.match(/_(\d+)_/)?.[1]; | ||
+ subPath = root.followsLink?.[index]?.followLink; | ||
+ subPath = root.followLinks?.[index]?.followLink; | ||
+ fullPath = interpolatedBaseUrl + subPath; | ||
+ } else if (root && root.followLink) { | ||
+ subPath = root.followLink; | ||
+ fullPath = interpolatedBaseUrl + subPath; | ||
+ } | ||
+ if (root && !subPath) { | ||
+ return | ||
+ return; | ||
+ } | ||
+ | ||
const headers = {}; | ||
for (const headerName in globalOperationHeaders) { | ||
const nonInterpolatedValue = globalOperationHeaders[headerName]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/node_modules/graphql/jsutils/devAssert.js b/node_modules/graphql/jsutils/devAssert.js | ||
index c40d406..c21c8ef 100644 | ||
--- a/node_modules/graphql/jsutils/devAssert.js | ||
+++ b/node_modules/graphql/jsutils/devAssert.js | ||
@@ -9,6 +9,6 @@ function devAssert(condition, message) { | ||
const booleanCondition = Boolean(condition); | ||
|
||
if (!booleanCondition) { | ||
- throw new Error(message); | ||
+ console.error(message); | ||
} | ||
} |