Skip to content

Commit f535f7e

Browse files
committed
Possibility for custom resolver
1 parent 24b6c57 commit f535f7e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ build.schemaFromEndpoints = schemaFromEndpoints;
5151

5252
function resolver(endpoint) {
5353
return (_, args, opts) => {
54+
if (endpoint.resolver) {
55+
return endpoint.resolver(args, opts);
56+
}
5457
const req = endpoint.request(args, {
5558
baseUrl: opts.GQLProxyBaseUrl
5659
});
@@ -78,4 +81,4 @@ function getQueriesFields(endpoints, isMutation) {
7881
}, {});
7982
}
8083

81-
module.exports = build;
84+
module.exports = build;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-to-graphql",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)