Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// TODO this need improvement
// not sure is it right
@Subscription('dateChanged')
async dateChanged(obj, args, context, info) {
return {
subscribe: async () => {
return await ownerSubscription.asyncIterator('dateChanged');
},
};
}
@DelegateProperty('chirps')
findChirpsByUserId() {
return (mergeInfo: MergeInfo) => ({
fragment: `fragment OwnerFragment on Owner { _id }`,
resolve(parent, args, context?, info?) {
const ownerId = parent._id;
return mergeInfo.delegate(
'query',
'chirpsByOwnerId',
{
ownerId,
},
context,
info,
);
},