mickhansen / graphql-sequelize

GraphQL & Relay for MySQL & Postgres via Sequelize
MIT License
1.9k stars 172 forks source link

Empty response with basic resolver usage #604

Closed bschulte closed 6 years ago

bschulte commented 6 years ago

Versions:

Node: v9.4.0

"graphql": "^0.13.2" "graphql-relay": "^0.5.5" "graphql-sequelize": "^8.1.1" "apollo-server-express": "^1.3.6"

I'm trying to get up and running using graphql-sequelize + apollo-server and I'm having an issue where using resolver from graphql-sequelize returns and empty result set.

I'm able to have things working properly when manually using the sequelize model like so which returns all users as expected. However, swapping to using the resolver as shown in the image, no users are returned from the resolver.

image

bschulte commented 6 years ago

Well I feel a bit silly, seems like the query expects the resolver function as the value, not the return value of the function. In other words, it should look like this:

image