Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Idempotent mutations with no impact shouldn't modify "Updated at"

Repro:

1. Run an idempotent mutation (example one shown below)

2. Observe that labels are added to the issue and the "updatedAt" field is now whenever you ran the mutation (this is good)

3. Run the same idempotent mutation again

4. Nothing happened, which is good, except...

5. Observe that the "updatedAt" field has changed (this is bad)

 

This is really not great for several reasons:

 * It's confusing for users because the issue now appears at the top of "Most recently updated" even though nothing observable has happened

 * It's confusing for API developers because there's no associated timeline event (thank goodness!), so the updatedAt field will *sometimes* not match the last timeline event

 * It creates needless work for tools that operate on a "Don't do anything if the issue is unchanged since the last time I looked at it" basis

 * It's extra work for GraphQL apps who don't want to trigger this behavior, because they have to compute themselves whether their proposed mutation is actually needed, which goes against the spirit of GraphQL mutations

 

mutation setLabels {
  addLabelsToLabelable(input: {
    labelableId: "MDU6SXNzdWU1MDU0NjA4ODE=",
    labelIds: ["MDU6TGFiZWwxMDE3NjU4MTk5", "MDU6TGFiZWwxMDE3NjU4MjAw"]
  }) {
    clientMutationId
  }
}
1 Reply
Community Manager
Message 2 of 2

Re: Idempotent mutations with no impact shouldn't modify "Updated at"

 
Thanks for this great feedback! We're always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I've logged your feature request in our internal feature request list. Though I can't guarantee anything or share a timeline for this, I can tell you that it's been shared with the appropriate teams for consideration.

Thank you for your perspective and your contribution!
All the Best

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!