
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@fruits-chain/qiufen-pro-graphql-mock
Advanced tools
yarn add @fruits-chain/qiufen-pro-graphql-mock -D
interface GraphqlKitConfig {
/** your qiufen service port */
port: number
/** backend service config */
endpoint: ServiceConfig
/** local graphql schema file path */
localSchemaFile?: string
/** use either local schema or remote schema, if unset, remote will be used */
schemaPolicy?: SchemaPolicy
/** mock config */
mock?: MockConfig
}
interface ServiceConfig {
/** backend service url */
url: string
}
interface MockConfig {
/** value map rules, you should add all your scalar type mappers here or you'll get an error */
scalarMap: any
/** graphql resolvers for operations, you can custom operation response here */
resolvers?: any
}
type SchemaPolicy = 'local' | 'remote'
interface PlaygroundConfig {
/** request headers */
headers?: Record<string, string>
}
// demo of configure
const Mock = require('mockjs')
const { GraphqlKitConfig } = require('@fruits-chain/qiufen-pro-graphql-mock')
const { Random } = Mock
//@ts-check
/** @typedef {GraphqlKitConfig} Config **/
/** @type Config */
const config = {
port: 4200,
// Local schema file path
localSchemaFile: './src/graphql/generated/schema.graphql',
// "remote" | "local". When the remote gateway fails, you are advised to set it to "local" and specify the path of the local schema file.
schemaPolicy: 'remote',
endpoint: {
// remote schema address
url: 'http://localhost:4000/graphql',
},
mock: {
scalarMap: {
Int: () => Random.integer(0, 100),
String: () => Random.ctitle(2, 4),
ID: () => Random.id(),
Boolean: () => Random.boolean(),
BigDecimal: () => Random.integer(0, 1000000),
Float: () => Random.float(0, 100),
Date: () => Random.date(),
DateTime: () => Random.datetime(),
Long: () => Random.integer(0, 10000),
NumberOrBoolOrStringOrNull: () => null,
NumberOrString: () => null,
Object: () => ({}),
},
resolvers: {
Query: {
/* Custom field interface return */
// ListTaskBoard: () => {
// return [
// {
// commodityName: "111111111",
// commoditySpecOptionName: "争11232131231212果",
// commodityTypeName: "样情",
// completedQuantity: "府委产",
// createBy: "火传离那",
// customerName: "布红系",
// customerTypeName: "报件指加",
// expectSaleQuantity: "容规数",
// index: 47,
// leaderName: "车做",
// line: "质身管手",
// planId: "320000201903036414",
// planProductionQuantity: "年着",
// productionType: "专本学",
// schedule: "再严今花",
// },
// ]
// },
},
},
},
}
module.exports = config
const {
executeQiufenMockingServer,
} = require('@fruits-chain/qiufen-pro-graphql-mock')
executeQiufenMockingServer()
import { startMockingServer } = require('@fruits-chain/qiufen-pro-graphql-mock')
startMockingServer(config) // config above
FAQs
Mocking graphql schema capabilities
We found that @fruits-chain/qiufen-pro-graphql-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.