There is a
- query player and
- subscription playerJoinedTable.
Both should return PlayerType and both receive object with property profileId.
PlayerType has property profile with resolver:
profile: {
type: ProfileType,
resolve: (obj, args, {db}) => {
return db.collection('profiles').findOne({_id: ObjectID(obj.profileId)})
}
}
When server is asked for query player it returns both fields from players table and profile object with profile fields.
But when subscription below:
playerJoinedTable: {
type: PlayerType,
resolve: payload => payload,
subscribe: () => pubsub.asyncIterator('playerJoinedTable')
is executed, the server returns only player's own fields without executing profile's resolver.
Any idea why the subscription doesn't execute nested resolver?