Non integer id broken with mutation
See original GitHub issueIf 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:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, that sounds good. Thanks for the reply!
I will try to move to string based IDs soon, however PRs are welcome 😃
Should be working with the next release.