plugin-graphql icon indicating copy to clipboard operation
plugin-graphql copied to clipboard

Custom query not working returning Couldn't find Type of name UserInput in the GraphQL Schema.

Open davidubanyi opened this issue 4 years ago • 3 comments

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 runningawait 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

davidubanyi avatar Oct 02 '20 20:10 davidubanyi

Got exactly the same. Any ideas?

timvandesteeg avatar Oct 12 '20 13:10 timvandesteeg

The same here, but with $push() updated entity.

pich avatar Nov 29 '20 21:11 pich

Same issue, getting Couldn't find Type of name UserInput in the GraphQL Schema

mycloudcodehub avatar Dec 24 '20 15:12 mycloudcodehub