New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@truebill/graphql-sequelize

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@truebill/graphql-sequelize - npm Package Compare versions

Comparing version 8.3.1 to 8.3.2

7

lib/relay.js

@@ -19,2 +19,3 @@ 'use strict';

exports.createNodeInterface = createNodeInterface;
exports.getInnerType = getInnerType;
exports.nodeType = nodeType;

@@ -122,4 +123,8 @@ exports.createConnection = createConnection;

exports.sequelizeNodeInterface = createNodeInterface;
function getInnerType(type) {
return type instanceof _graphql.GraphQLNonNull ? type.ofType : type;
}
function nodeType(connectionType) {
return connectionType._fields.edges.type.ofType._fields.node.type;
return getInnerType(getInnerType(connectionType._fields.edges.type).ofType)._fields.node.type;
}

@@ -126,0 +131,0 @@

27

lib/resolver.js

@@ -58,4 +58,4 @@ 'use strict';

model = isAssociation && target.target || isModel && target,
type = info.returnType,
list = options.list || type instanceof _graphql.GraphQLList || type instanceof _graphql.GraphQLNonNull && type.ofType instanceof _graphql.GraphQLList;
type = (0, _relay.getInnerType)(info.returnType),
list = options.list || type instanceof _graphql.GraphQLList;

@@ -87,2 +87,9 @@ let targetAttributes = Object.keys(model.rawAttributes),

function handleResult(result) {
if (options.handleConnection && (0, _relay.isConnection)((0, _relay.getInnerType)(info.returnType))) {
return (0, _relay.handleConnection)(result, args);
}
return result;
}
return _bluebird2.default.resolve(options.before(findOptions, args, context, info)).then(function (findOptions) {

@@ -101,19 +108,9 @@ if (args.where && !_lodash2.default.isEmpty(info.variableValues)) {

// The user did a manual include
const result = source.get(association.as);
if (options.handleConnection && (0, _relay.isConnection)(info.returnType)) {
return (0, _relay.handleConnection)(result, args);
}
return result;
return handleResult(source.get(association.as));
} else {
return source[association.accessors.get](findOptions).then(function (result) {
if (options.handleConnection && (0, _relay.isConnection)(info.returnType)) {
return (0, _relay.handleConnection)(result, args);
}
return result;
});
return source[association.accessors.get](findOptions).then(handleResult);
}
}
return model[list ? 'findAll' : 'findOne'](findOptions);
return model[list ? 'findAll' : 'findOne'](findOptions).then(handleResult);
}).then(function (result) {

@@ -120,0 +117,0 @@ return options.after(result, args, context, info);

{
"name": "@truebill/graphql-sequelize",
"version": "8.3.1",
"version": "8.3.2",
"description": "GraphQL & Relay for MySQL & Postgres via Sequelize",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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