Vuex ORM is a plugin for Vuex to enable Object-Relational Mapping access to the Vuex Store
Questions tagged [vuex-orm]
33 questions
3
votes
0 answers
Removing many-to-many relationship via update in Vuex-ORM
I'm wondering if it is possible to remove relationships between two models by simply updating a model on one side of the relationship. Adding new relationships just works fine but removing seems not to be an option but maybe I am just missing…

Tomme
- 101
- 1
- 5
2
votes
0 answers
Testing VuexOrm with vue test utils and jest
this is my first question here. And my english is not to good. please forgive me for that. ;)
i need help for use vuexOrm with unit testing.
I will test an new model create with jest testing.
e.g. const user = new User - with a trigger
my mock is…

Krolian82
- 21
- 1
2
votes
1 answer
Lighthouse GraphQL casts ID to string instead of Integer?
I have an app that uses Laravel and Lighthouse on the backend, and Nuxt and Vuex-ORM/graphql-plugin on the frontend. I'm having a difficult time with comparisons because for whatever reason, sometimes data is queried or mutated and IDs seem to be a…

J. Jackson
- 3,326
- 8
- 34
- 74
2
votes
1 answer
how to handle nested objects in vuex-orm
i have this object:
userRights
{
"admin": true,
"rights": [
{
"id": 1,
"value": true
},
{
"id": 2,
"value": true
},
{
"id": 3,
"value": true
},
{
"id": 4,
"value": true
…

Deniz
- 1,435
- 14
- 29
2
votes
1 answer
Inserting data in vuex-orm database that is already normalized
Assuming the data i receive is already normalized, or at least the relations.
How can this data be inserted into the vuex-orm database?
Example JSON data:
{
"carmodel": [
{
"id": 1,
"title": "M3",
"manufacturer_id": 1
},
…

kimomat
- 2,211
- 23
- 37
2
votes
2 answers
Two way data binding with Vuex-ORM
Does anybody know of a library or an already described pattern for achieving two way data binding in forms when using Vuex ORM?
I've found a couple of libraries for helping with this with Vuex, but none specifically for Vuex-ORM…

John Rix
- 6,271
- 5
- 40
- 46
1
vote
0 answers
Partial mutations with vuex-orm over graphql?
Background:
I use mongodb where a typical document may contain fields with large values. A description field may hold over 200KB.
The same document also contains a title field which is limited to 64 characters (max).
I’d like to setup the code so…

tivoni
- 1,990
- 4
- 19
- 37
1
vote
1 answer
Adding Vuex-ORM to Laravel Nova tool
Can someone help me out with adding vuex-orm to a Laravel Nova Tool.
The base of a Laravel Nova tool has tool.js with the following content ('planning-tool' in name, and path may vary according to the name of your tool):
Nova.booting((Vue, router,…

Reflexecute
- 271
- 4
- 14
1
vote
0 answers
Vuex ORM define id´s for objects inside properties
I get a response from an API looking like this:
{
"error": null,
"h": {
"event": "EVENT",
"date": 1621265337566,
"edited": "me",
"changed": [
{
"old": "",
"new":…

Frossy
- 448
- 7
- 17
1
vote
0 answers
Component being re-rendered even if the corresponding record is unchanged - Vue JS, Vuex ORM
I have an application on Vue JS that receives the data from the server via WebSocket and renders the changes. I am using Vuex ORM for defining entities in the store. The problem I am facing is that if an update is received that has changes for a…

Anss
- 664
- 2
- 7
- 23
1
vote
0 answers
Vuex, is there a cache-and-network request policy? Can I persist the store in browser for subsequent immediate visits?
I'm coming from years with Apollo and GraphQL.
I wanna create a small project using Vue and simple REST API.
I read about Vuex, I wanna know:
Is there a way to persist the store in browser so if I restart the browser window (or if I close and…

Fred Hors
- 3,258
- 3
- 25
- 71
1
vote
0 answers
Why I don't have typo in vuex/orm?
I create a User model using vuex-orm and I want to access to its property email.
but the ide/typescript doesn't fill the properties.
vuex-orm is supported with typescript typo.
When I try to access using JavaScript I able to execute this code and…

Jon Sud
- 10,211
- 17
- 76
- 174
1
vote
1 answer
Vuex ORM models dependency cycle
In the store, I have two related models: Company and User
User
import { Model } from '@vuex-orm/core';
import { Company } from './models';
export class User extends Model {
static entity = 'users';
static fields() {
return {
company:…

Marek
- 307
- 3
- 13
1
vote
1 answer
Cannot access associated entity data in Vuex ORM join/pivot table
I've set up a pivot table for tasks/categories called TaskCategory. When I access it from Tasks, I cannot access the categories, even though there is a relationship set up.
Steps to reproduce the problem
Define models [...]
Task.js
import {Model}…

DevLime
- 937
- 2
- 9
- 19
1
vote
1 answer
Unable to access vuex-orm $db variable from store in nuxt
Using nuxtjs with vuexorm & vuexorm-axios plugin.
/pages/index.vue
computed: {
users() {
// this works as expected
return User.all()
}
}
plugins/vuex-orm-axios.js
import { Model } from '@vuex-orm/core'
export default ({ $axios })…

Abhilash
- 2,864
- 3
- 33
- 67