Subscriptions are working basically which means they fire an event on create, delete, update and not anymore multiple times ;)
I have following problem now. The queries in the resolver are not returning the expected result.
I can add multiple posts but i will get every time the same aggregation count value.
So on first time the resolver enters -> right value.
All other resolvers will return the same value.
Looks like db.query requests are returning cached values.
export const postSubscriptions = {
postsCount: {
resolve: (payload, args, context, info) => {
const connection = await db.query.postsConnection(
{ where: ... },
'{ aggregate { count } }'
);
return {
count: connection.aggregate.count;
};
},
subscribe: (parent, args, ctx: Context, info) => {
return db.subscription.post({});
}
}
};
type Subscription {
postsCount: Meta
}
type Meta {
count: Int
}
Hey, I wonder if this is the same problem as this one: https://github.com/graphcool/http-link-dataloader/issues/3
Could you try to apply the mentioned fix and see if it solves your problem as well?
Yes tried the solution and it is working! So this ticket can be closed and fixed by the other one ;)
Thanks for reporting @tfiwm! As described here: https://github.com/graphcool/http-link-dataloader/issues/3
This was due to the Dataloader caching, which is disabled by default now.