question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing clientIDMutation when using relay.ClientIDMutation

See original GitHub issue

Hi, I’m using an example relay.ClientIDMutation from the docs but the clientIDMutation argument seems to missing? Looking at the source code, it looks like it’s been commented out?

I’m wondering whether this is intentional and we should add it ourselves like so:

class QuestionMutation(relay.ClientIDMutation):
    class Input:
        text = graphene.String(required=True)
        id = graphene.ID()
        client_mutation_id = graphene.String()

    question = graphene.Field(QuestionType)

    @classmethod
    def mutate_and_get_payload(cls, root, info, text, id):
        question = Question.objects.get(pk=from_global_id(id)[1])
        question.text = text
        question.save()
        return QuestionMutation(question=question)

or whether it’s a bug?

Many thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
cglacetcommented, Jan 31, 2021

I can’t find any documentation on this, am I missing something (I only found this small example another example here).

To me it’s still rather unclear what these code do, for example there is an unused variable client_mutation_id in the second example mutation.

0reactions
stale[bot]commented, Dec 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the graphene.relay.ClientIDMutation function in ...
To help you get started, we've selected a few graphene.relay.ClientIDMutation examples, based on popular ways it is used in public projects.
Read more >
Use an InputObjectType instance as Input for relay mutation
clientIDMutation class. Try this. Declare this class before initiating you relay class. class Bar(graphene.InputObjectType): arg1 = graphene.
Read more >
Mutations - Relay - Graphene-Python
In GraphQL, this is done using mutations. Just like queries, Relay puts ... class IntroduceShip(relay.ClientIDMutation): class Input: ship_name = graphene.
Read more >
Python & GraphQL. Tips, tricks and performance improvements.
Recently I've finished another back-end with GraphQL, but now on Python. ... ClientIDMutation): class Meta: ... class FilteredRelayConnection(relay.
Read more >
Graphene Documentation - Read the Docs
For more advanced use, check out the Relay tutorial. ... A Relay mutation must inherit from ClientIDMutation and implement the.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found