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.

Make Update mutations backward compatible

See original GitHub issue

Problem

I am SUPER frustrated that in 2.6.x, all of a sudden, the update syntax changed. This requires a major change to my entire client code base, and so i am simply not going to upgrade from 2.5.1 for a while.

Most of the time i just want to set a new value, esp for strings, so can we default to set.

Instead of passing down:

{
   field1: value,
   submodel: { 
      update: {
        subfield1: value
     }
}

I have to now pass down:

{
    field1: { set value },
    submodel: {
       update: {
          subfield1: { set: value }
      }
   }
}

Suggested solution

Please support the old syntax, and implicitly take it as “set”.

Alternatives

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Sep 21, 2020

What version are you testing this with @srisub1? 2.6.x got two patch releases 2.6.1 and 2.6.2 as these changes were unwanted and accidental.

Using 2.6.2 or any of the 2.7.x releases you should not observe these differences any more.

0reactions
pantharshit00commented, Sep 22, 2020

Yeah this does seem to be duplicate of https://github.com/graphql-nexus/nexus-plugin-prisma/issues/830. Pleas follow that issue, it has gained quite a lot of upvotes so it is likely to be addressed. Thanks!

I am going to close this here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to extend or update a resolver to allow backwards ...
My problem is that I have to maintain backward compatibility that means I've been using until now preferredContact and the new field is ......
Read more >
Changing GraphQL Types Without Breaking Changes
Even if your GraphQL API is only internally facing, most type changes are costly to do in a backwards compatible way. Extra thought...
Read more >
Upsert Mutations - GraphQL - Dgraph
Upsert Mutations · The default value of uspert will be false , for backward compatibility. · The current behavior of Add and Update...
Read more >
Detect Breaking Changes in Your GraphQL Schema ... - Medium
This implies that each change must be checked for backwards compatibility. In this blog post we automate this check for each pull request...
Read more >
GraphQL schema basics
The schema also specifies exactly which queries and mutations are available for ... Most additive changes to a schema are safe and backward...
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