
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@bn-digital/graphql-config
Advanced tools
GraphQL Types generator configuration and preset, used in @bn-digital projects
Add dependencies to package.json
following configuration options.
In case of workspaces, add snippet to project root file. Examples provided considering default @bn-digital project structure and Strapi connected.
{
"devDependencies": {
"@graphql-codegen/cli": "^2.2.0",
"@bn-digital/graphql-codegen": "^1.0.0"
},
"scripts": {
"graphql": "graphql-codegen --watch"
}
}
.graphqlconfig
exists in project root with similar content (change %app-name%
at least):{
"name": "BN Digital",
"schemaPath": "./packages/cms/exports/graphql/schema.graphql",
"includes": [
"packages/*/exports/graphql/*/*.graphql",
"packages/*/api/*/config/graphql.schema.js",
"packages/*/extensions/*/config/graphql.schema.js",
"packages/*/src/graphql/*/*.graphql"
],
"extensions": {
"endpoints": {
"development": {
"url": "http://localhost:1337/graphql"
},
"staging": {
"url": "https://%application%.bndigital.dev/graphql"
}
}
}
}
codegen.yaml
exists in project root with similar content (change %app-name%
at least):schema: packages/cms/exports/graphql/schema.graphql
documents:
- packages/cms/exports/graphql/fragments/*.graphql
hooks:
afterAllFileWrite:
- eslint --fix --quiet
- prettier --write
config:
avoidOptionals: true
dedupeFragments: true
noExport: false
preResolveTypes: true
strictScalars: true
withComponent: true
withHooks: true
withResultType: true
scalars:
Upload: unknown
Date: Date
Time: Date
JSON: Record<string, any>
Long: number
DateTime: Date
generates:
packages/website/src/graphql/index.ts:
documents:
- packages/website/src/graphql/**/*.graphql
plugins:
- typescript
- typescript-operations
- typescript-react-apollo
packages/website/tsconfig.json
:{
"compilerOptions": {
"types": ["src/graphql"]
}
}
Use following command for continuous types generation. It will generate required scripts and watch for used *.graphql
file changes, so types will be automatically updated.
IDE types resolution and availability could be bit delayed in terms of change detection or typescript recompile.
yarn graphql
FAQs
GraphQL Types generator configuration and preset, used in @bn-digital projects
The npm package @bn-digital/graphql-config receives a total of 155 weekly downloads. As such, @bn-digital/graphql-config popularity was classified as not popular.
We found that @bn-digital/graphql-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.