
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
egg-graphql-apollo
Advanced tools
插件参考了 egg-graphql
,并与 egg-graphql
配置保持一致。不同的地方是文件结构定义和编写方式。
egg-graphql-apollo
推荐 graphql
模型定义及 resolvers
等相关逻辑在 app/graphql
目录中实现。
例如:
// app/graphql/user_info.js
exports.typeDef = `
type UserInfo {
id: Int!
name: String!
createdAt: Date! @date(format: "YYYY-MM-DD")
}
`;
exports.resolver = {
Query: {
user(root, { id }, ctx) {
return ctx.service.userInfo.fetchById(id);
},
},
};
exports.directiveResolver = {};
exports.schemaDirective = {};
每个 js 文件输出可选 typeDef
、resolver
、directiveResolver
、schemaDirective
,具体见测试用例,API: graphql-tools。这样做的好处是业务归类清晰、graphql schema
可组合。
你也可以编写 .graphql
文件,插件会加载并组合它们。
$ npm i egg-graphql-apollo
在 config/plugin.js
开启插件:
exports.graphql = {
package: 'egg-graphql-apollo',
};
在 config/config.${env}.js
配置 graphql
的路由。
// config/config.${env}.js
exports.graphql = {
router: '/graphql',
graphiql: true,
onPreGraphQL: async (ctx) => {},
onPreGraphiQL: async (ctx) => {},
};
请参考测试用例的目录结构, 以及 dataloader
的使用。
MIT
FAQs
egg graphql-tools plugin
The npm package egg-graphql-apollo receives a total of 1 weekly downloads. As such, egg-graphql-apollo popularity was classified as not popular.
We found that egg-graphql-apollo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.