
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.
graphql-directive-computed-property
Advanced tools
The directive allows creating a computed property from fields where is defined.
yarn add graphql-directive-computed-property
This package requires graphql and graphql-tools as peer dependency
const { makeExecutableSchema } = require('graphql-tools');
const computedDirective = require('graphql-directive-computed-property');
const typeDefs = `
type User {
firstName: String
lastName: String
fullName: String @computed(value: "$firstName $lastName")
}
type Query {
me: User
}
`;
const resolvers = {
Query: {
me: () => ({
firstName: 'John',
lastName: 'Doe',
}),
},
};
module.exports = makeExecutableSchema({
typeDefs,
resolvers,
schemaDirectives: {
computed: computedDirective,
},
});
Query:
query {
me {
fullName
}
}
Result:
{
fullName: 'John Doe'
}
Example:
admin: String @rest(url: "${URL_TO_API}") @computed(value: "Are you admin? $admin")
Directive params:
value
: StringThe calculated value. It can contain other fields from the type in which it is defined.
Example:
@computed(value: "$firstName $lastName")
@computed(value: "$price $")
I would love to see your contribution. ❤️
For local development (and testing), all you have to do is to run yarn
and then yarn dev
. This will start the Apollo server and you are ready to contribute :tada:
Run yarn test (try --watch
flag) for unit tests (we are using Jest)
The MIT License (MIT) 2018 - Luke Czyszczonik - mailto:lukasz.czyszczonik@gmail.com
FAQs
GraphQL directive for create computed property
The npm package graphql-directive-computed-property receives a total of 1 weekly downloads. As such, graphql-directive-computed-property popularity was classified as not popular.
We found that graphql-directive-computed-property 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.