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

Method mutate

hackernews/backend-python/links/schema.py:61–76  ·  view source on GitHub ↗
(self, info, url, description)

Source from the content-addressed store, hash-verified

59 description = graphene.String()
60
61 def mutate(self, info, url, description):
62 user = info.context.user or None
63
64 link = Link(
65 url=url,
66 description=description,
67 posted_by=user,
68 )
69 link.save()
70
71 return CreateLink(
72 id=link.id,
73 url=link.url,
74 description=link.description,
75 posted_by=link.posted_by,
76 )
77
78
79class CreateVote(graphene.Mutation):

Callers

nothing calls this directly

Calls 2

LinkFunction · 0.90
CreateLinkClass · 0.85

Tested by

no test coverage detected