GraphQLGuide / apollo-datasource-mongodb

Apollo data source for MongoDB
MIT License
285 stars 64 forks source link

Problem on `context` => `{ dataSources: { users } }` #23

Closed thearabbit closed 4 years ago

thearabbit commented 4 years ago

Document

const resolvers = {
  User: {
    posts: (user, _, { posts }) => posts.getPosts(user.postIds)
  }
}

Should be change

const resolvers = {
  User: {
    posts: (user, _, { dataSources: { posts } }) => posts.getPosts(user.postIds)
  }
}
lorensr commented 4 years ago

Thanks!