
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
pothos-plugin-result
Advanced tools
A Pothos plugin for easily creating GraphQL schemas that reflect the results of specific actions.
A Pothos plugin for easily creating GraphQL schemas that reflect the results of specific actions.
$ yarn add pothos-plugin-result
import ResultPlugin from 'pothos-plugin-result';
const builder = new SchemaBuilder({
plugins: [ResultPlugin],
});
builder.mutationType({
fields: (t) => ({
createPost: t.result({
type: {
createdPost: PostRef,
allPosts: [PostRef],
currentUser: UserRef,
},
nullable: true,
resolve: () => ({
createdPost: { id: 2, /* ... */ },
allPosts: [{ id: 1, /* ... */ }, { id: 2, /* ... */ }],
currentUser: { id: 1, /* ... */ }
}),
}),
});
});
t.result
only can be used in mutation type.t.result
are limited to objects. Array types are not supported.MIT
FAQs
A Pothos plugin for easily creating GraphQL schemas that reflect the results of specific actions.
The npm package pothos-plugin-result receives a total of 117 weekly downloads. As such, pothos-plugin-result popularity was classified as not popular.
We found that pothos-plugin-result demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.