Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
davidubanyi opened this issue Oct 2, 2020 · 3 comments

Comments

@davidubanyi
Copy link

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

@timvandesteeg
Copy link
Contributor

Got exactly the same. Any ideas?

@pich
Copy link

pich commented Nov 29, 2020

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

@mycloudcodehub
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants