Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@orion-js/resolvers

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orion-js/resolvers - npm Package Compare versions

Comparing version 3.0.0 to 3.0.6

lib/resolver/getArgs.d.ts

10

lib/resolver/index.js

@@ -12,2 +12,3 @@ "use strict";

const cleanReturns_1 = __importDefault(require("./cleanReturns"));
const getArgs_1 = require("./getArgs");
const createResolver = function (options) {

@@ -22,7 +23,12 @@ options.params = (0, cleanParams_1.default)(options.params);

}
const resolve = options.resolve;
const execute = (0, getExecute_1.default)(options);
const resolve = async (...args) => {
let { parent, params, viewer } = (0, getArgs_1.getArgs)(...args);
const executeOptions = { parent, params, viewer };
return await execute(executeOptions);
};
const resolver = {
...options,
resolve,
execute: (0, getExecute_1.default)(options)
execute
};

@@ -29,0 +35,0 @@ return resolver;

@@ -11,2 +11,3 @@ "use strict";

expect(typeof resolver).toBe('object');
expect(typeof resolver.resolve).toBe('function');
expect(typeof resolver.execute).toBe('function');

@@ -96,2 +97,5 @@ expect(typeof resolver.resolverId).toBe('string');

};
},
initItem(item) {
return item;
}

@@ -123,2 +127,5 @@ };

};
},
initItem(item) {
return item;
}

@@ -148,1 +155,15 @@ };

});
it('should allow calling resolver.resolve', async () => {
const resolver = (0, index_1.resolver)({
resolve: async ({ title }) => {
return `${title}`;
}
});
const modelResolver = (0, index_1.modelResolver)({
resolve: async ({ title }) => {
return `${title}`;
}
});
expect(await resolver.resolve({ title: 'test' })).toBe('test');
expect(await modelResolver.resolve({ title: 'test' })).toBe('test');
});

4

package.json
{
"name": "@orion-js/resolvers",
"version": "3.0.0",
"version": "3.0.6",
"main": "lib/index.js",

@@ -34,3 +34,3 @@ "types": "lib/index.d.ts",

},
"gitHead": "27bda585ffc16d92c70c958227605f3b61171c64"
"gitHead": "91b207f9f7afa418177b5aeace2e5f9b0a0ef04d"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc