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.

Non integer id broken with mutation

See original GitHub issue

If a mutation returns a non integer id (like a relay node), a new record with id NaN is created. I found this while debugging: https://github.com/vuex-orm/plugin-graphql/blob/0730a86e8efa4e584312c49bd7d5a3eb54ba5fb0/src/actions/action.ts#L44 Something like this might be better:

const newId = Number.parseInt(newData.id, 10);
if (!Number.isNaN(newId)) {
    newData.id = newId;
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
phortxcommented, Oct 12, 2018

Ok, that sounds good. Thanks for the reply!

I will try to move to string based IDs soon, however PRs are welcome 😃

0reactions
phortxcommented, May 21, 2019

Should be working with the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Nuxt store getter not working, ID given to payload is ...
Nuxt store getter not working, ID given to payload is not an Integer + Error: [vuex] do not mutate vuex store state outside...
Read more >
Five Common Problems in GraphQL Apps (And How to Fix ...
One of the first things you realize when coding a GraphQL back-end from scratch is that it involves a lot of similar-but-not-quite-identical ...
Read more >
boxed/mutmut: Mutation testing system - GitHub
Mutmut is a mutation testing system for Python, with a strong focus on ease of ... mutmut apply 3 (replace 3 with the...
Read more >
Learning GraphQL By Doing - DigitalOcean
Here we are defining a variable called id, as denoted by the prefix $ and it is of type Int. The ! indicates...
Read more >
Specification Mutation for Test Generation and Analysis
Mutation analysis is a fault-based testing technique that uses mutation operators to introduce small changes into a program or specification, ...
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