MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / post

Function post

hackernews/backend-nodejs/src/resolvers/Mutation.js:5–18  ·  view source on GitHub ↗
(parent, args, context, info)

Source from the content-addressed store, hash-verified

3const { APP_SECRET } = require('../utils');
4
5async function post(parent, args, context, info) {
6 const { userId } = context;
7
8 const newLink = await context.prisma.link.create({
9 data: {
10 url: args.url,
11 description: args.description,
12 postedBy: { connect: { id: userId } }
13 }
14 });
15 context.pubsub.publish('NEW_LINK', newLink);
16
17 return newLink;
18}
19
20async function signup(parent, args, context, info) {
21 const password = await bcrypt.hash(args.password, 10);

Callers

nothing calls this directly

Calls 1

createMethod · 0.80

Tested by

no test coverage detected