
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@jcoreio/graphql-sequelize-extra
Advanced tools
some missing pieces of the graphql-sequelize bridge
npm install --save @jcoreio/graphql-sequelize-extra
associationFields(model, options)
const { associationFields } = require('@jcoreio/graphql-sequelize-extra')
Creates GraphQL fields for the given sequelize model
's associations
.
model: Class<Sequelize.Model<any>>
options: Object
options.getType: (model: Class<Sequelize.Model<any>>) => Object
(required)Gets the GraphQL type for the given sequelize model.
options.getArgs: (model: Class<Sequelize.Model<any>>) => Object
(optional)Gets the GraphQL args for the given sequelize model.
options.getResolver: (model: Class<Sequelize.Model<any>>, association: Sequelize.Association) => Function
(optional)Gets the GraphQL resolve
function for the given sequelize model and association.
A plain object of GraphQL fields for the given model
's
associations
.
You should use associationFields
within a fields
thunk since it some
types it needs would fail to be defined if there are circular
associations:
const { models } = sequelize
function getType(model) {
return types[model.name]
}
const types = mapValues(
models,
(model) =>
new graphql.GraphQLObjectType({
name: model.name,
fields: () => ({
...attributeFields(model),
...associationFields(model, { getType }),
}),
})
)
If you have circular associations, you should use some form of nested GraphQL query attack prevention.
FAQs
some missing pieces of the graphql-sequelize bridge
The npm package @jcoreio/graphql-sequelize-extra receives a total of 19 weekly downloads. As such, @jcoreio/graphql-sequelize-extra popularity was classified as not popular.
We found that @jcoreio/graphql-sequelize-extra demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.