X Tutup
The Wayback Machine - https://web.archive.org/web/20201014113840/https://github.com/vuex-orm/plugin-graphql/issues/162
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 · 1 comment

Comments

@davidubanyi
Copy link

@davidubanyi davidubanyi commented Oct 2, 2020

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

@timvandesteeg timvandesteeg commented Oct 12, 2020

Got exactly the same. Any ideas?

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.
X Tutup