| 36 | |
| 37 | |
| 38 | class RelayCreateLink(graphene.relay.ClientIDMutation): |
| 39 | link = graphene.Field(LinkNode) |
| 40 | |
| 41 | class Input: |
| 42 | url = graphene.String() |
| 43 | description = graphene.String() |
| 44 | |
| 45 | def mutate_and_get_payload(root, info, **input): |
| 46 | user = info.context.user or None |
| 47 | |
| 48 | link = Link( |
| 49 | url=input.get('url'), |
| 50 | description=input.get('description'), |
| 51 | posted_by=user, |
| 52 | ) |
| 53 | link.save() |
| 54 | |
| 55 | return RelayCreateLink(link=link) |
| 56 | |
| 57 | |
| 58 | class RelayMutation(graphene.AbstractType): |
no outgoing calls
no test coverage detected