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
Issue with apollo client. #26
Comments
This is most likely a problem in Join Monster. Can you post:
I want to try to reproduce this error. Also, if you have a public repo with the source code that I could check out, that would be great. |
Query works with GraphiQL but not for apollo client. Todo: const TodoType = new GraphQLObjectType({
name: 'Todo',
sqlTable: 'todos',
uniqueKey: 'id',
fields: () => ({
id: {
type: GraphQLInt,
},
task: {
type: GraphQLString,
},
completed: {
type: GraphQLBoolean,
},
comments: {
type: new GraphQLList(CommentType),
sqlJoin: (todoTable, commentTable) => `${todoTable}.id = ${commentTable}.todo_id`
}
})
}); Comment:
Root: const RootQuery = new GraphQLObjectType({
name: 'Query',
fields: () => ({
todos: {
type: new GraphQLList(TodoType),
resolve: (parent, args, context, resolveInfo) => {
return joinMonster(resolveInfo, context, sql => {
return knex.raw(sql);
});
}
},
})
}); |
Fixed in v0.5.1The problem was that the apollo client adds some introspection to your query. This is what apollo was actually sending to the server:
The problem was that Join Monster tried to look for a user-defined This is fixed. It should now work without modifying your code. |
oh, i see. |
I tried query with apollo client for graphql server that use join-monster and I got this error:
Not working with my own setup and join-monster-demo. I don't know this is problem with join monster or apollo client itself.
My apollo code look like this:
The text was updated successfully, but these errors were encountered: