Hi please I'm trying to return data from a custom query but the Type being generated by the plugin is wrong
My vue store index.js
`import Vue from "vue";
import Vuex from "vuex";
import VuexORM from "@vuex-orm/core";
import VuexORMGraphQL from "@vuex-orm/plugin-graphql";
import VuexPersistence from 'vuex-persist';
import { DefaultAdapter, ConnectionMode, ArgumentMode } from "@vuex-orm/plugin-graphql";
import database from "@/database";
class CustomAdapter extends DefaultAdapter {
// Your code here
my user model
`class User extends Model {
static entity = "users";
static fields() {
return {
id: this.attr(null),
first_name: this.string(""),
last_name: this.string(""),
email: this.string(""),
phone_number: this.string(""),
profile: this.hasOne(Profile, "user_id"),
contribution_plans: this.hasMany(ContributionPlan, "user_id")
};
}
}
`
Please I'll really like to know if I'm doing something wrong, I've tested this with another custom query and the result is the same
Hi please I'm trying to return data from a custom query but the Type being generated by the plugin is wrong
My vue store index.js `import Vue from "vue"; import Vuex from "vuex"; import VuexORM from "@vuex-orm/core"; import VuexORMGraphQL from "@vuex-orm/plugin-graphql"; import VuexPersistence from 'vuex-persist'; import { DefaultAdapter, ConnectionMode, ArgumentMode } from "@vuex-orm/plugin-graphql"; import database from "@/database";
class CustomAdapter extends DefaultAdapter { // Your code here
// Example getConnectionMode() { return ConnectionMode.PLAIN; } getArgumentMode() { return ArgumentMode.TYPE; } }
const vuexLocal = new VuexPersistence({ storage: window.localStorage, key: "emr-app" });
Vue.use(Vuex); VuexORM.use(VuexORMGraphQL, { database, url: "***", adapter: new CustomAdapter(), debug: true,
});
const store = new Vuex.Store({ plugins: [VuexORM.install(database), vuexLocal.plugin] });
export default store;
the query I'm running
await User.customQuery({ name: "GetCustomerById", filter: { id: this.users.id }, })`my user model `class User extends Model { static entity = "users";
static fields() { return { id: this.attr(null), first_name: this.string(""), last_name: this.string(""), email: this.string(""), phone_number: this.string(""), profile: this.hasOne(Profile, "user_id"), contribution_plans: this.hasMany(ContributionPlan, "user_id") }; } } ` Please I'll really like to know if I'm doing something wrong, I've tested this with another custom query and the result is the same