@graphql-mesh/graphql 0.102.13 → 0.102.14
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/cjs/index.js +8 -4
- package/esm/index.js +8 -4
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -103,7 +103,11 @@ class GraphQLHandler {
|
|
|
103
103
|
this.interpolationStringSet.add(headerName.toString());
|
|
104
104
|
});
|
|
105
105
|
const schemaHeadersFactory = (0, string_interpolation_1.getInterpolatedHeadersFactory)(httpSourceConfig.schemaHeaders || {});
|
|
106
|
-
|
|
106
|
+
const interpolatedSourcePath = httpSourceConfig.source &&
|
|
107
|
+
string_interpolation_1.stringInterpolator.parse(httpSourceConfig.source, {
|
|
108
|
+
env: cross_helpers_1.process.env,
|
|
109
|
+
});
|
|
110
|
+
if (interpolatedSourcePath) {
|
|
107
111
|
const opts = {
|
|
108
112
|
cwd: this.baseDir,
|
|
109
113
|
allowUnknownExtensions: true,
|
|
@@ -111,16 +115,16 @@ class GraphQLHandler {
|
|
|
111
115
|
fetch: this.fetchFn,
|
|
112
116
|
logger: this.logger,
|
|
113
117
|
};
|
|
114
|
-
if (!(0, utils_1.isUrl)(
|
|
118
|
+
if (!(0, utils_1.isUrl)(interpolatedSourcePath)) {
|
|
115
119
|
return this.nonExecutableSchema.getWithSet(async () => {
|
|
116
|
-
const sdlOrIntrospection = await (0, utils_1.readFile)(
|
|
120
|
+
const sdlOrIntrospection = await (0, utils_1.readFile)(interpolatedSourcePath, opts);
|
|
117
121
|
return this.getSchemaFromContent(sdlOrIntrospection);
|
|
118
122
|
});
|
|
119
123
|
}
|
|
120
124
|
const headers = schemaHeadersFactory({
|
|
121
125
|
env: cross_helpers_1.process.env,
|
|
122
126
|
});
|
|
123
|
-
const sdlOrIntrospection = await (0, utils_1.readUrl)(
|
|
127
|
+
const sdlOrIntrospection = await (0, utils_1.readUrl)(interpolatedSourcePath, {
|
|
124
128
|
...opts,
|
|
125
129
|
headers,
|
|
126
130
|
});
|
package/esm/index.js
CHANGED
|
@@ -100,7 +100,11 @@ export default class GraphQLHandler {
|
|
|
100
100
|
this.interpolationStringSet.add(headerName.toString());
|
|
101
101
|
});
|
|
102
102
|
const schemaHeadersFactory = getInterpolatedHeadersFactory(httpSourceConfig.schemaHeaders || {});
|
|
103
|
-
|
|
103
|
+
const interpolatedSourcePath = httpSourceConfig.source &&
|
|
104
|
+
stringInterpolator.parse(httpSourceConfig.source, {
|
|
105
|
+
env: process.env,
|
|
106
|
+
});
|
|
107
|
+
if (interpolatedSourcePath) {
|
|
104
108
|
const opts = {
|
|
105
109
|
cwd: this.baseDir,
|
|
106
110
|
allowUnknownExtensions: true,
|
|
@@ -108,16 +112,16 @@ export default class GraphQLHandler {
|
|
|
108
112
|
fetch: this.fetchFn,
|
|
109
113
|
logger: this.logger,
|
|
110
114
|
};
|
|
111
|
-
if (!isUrl(
|
|
115
|
+
if (!isUrl(interpolatedSourcePath)) {
|
|
112
116
|
return this.nonExecutableSchema.getWithSet(async () => {
|
|
113
|
-
const sdlOrIntrospection = await readFile(
|
|
117
|
+
const sdlOrIntrospection = await readFile(interpolatedSourcePath, opts);
|
|
114
118
|
return this.getSchemaFromContent(sdlOrIntrospection);
|
|
115
119
|
});
|
|
116
120
|
}
|
|
117
121
|
const headers = schemaHeadersFactory({
|
|
118
122
|
env: process.env,
|
|
119
123
|
});
|
|
120
|
-
const sdlOrIntrospection = await readUrl(
|
|
124
|
+
const sdlOrIntrospection = await readUrl(interpolatedSourcePath, {
|
|
121
125
|
...opts,
|
|
122
126
|
headers,
|
|
123
127
|
});
|