vuex-orm / plugin-graphql

Vuex ORM persistence plugin to sync the store against a GraphQL API.
https://vuex-orm.github.io/plugin-graphql/
MIT License
227 stars 52 forks source link

method .all() not returns pure literal object from database (store) #177

Open creaux opened 3 years ago

creaux commented 3 years ago

I'm trying to understand without digging deeply what exactly following method returns:

this.$store.$db().model("someModel").all()

I would expect as based on familiarity with Redux that this will be pure object literal only with properties based on model. But it is not the case it actually returns even these properties:

{
  $id: '1',
  $isPresitant: false,
  $self: ...
  ...
}

Somewhere else we define model.

class SomeModel extends Model { }

So looks to me like instance of SomeModel. Which is fine as it can be sanitized for example by remaping properties.

But I really wonder that I haven't found yet more sophisticated solution which incorporated directly to VuexORM or do I missing something?