import { withFilter } from 'graphql-subscriptions'; import { GraphQLString } from 'graphql'; import { MATERIALS_UPLOAD_UPDATED } from './events'; import { subscribe } from '../../pubsub'; import { materialsUploadStatusType } from './types'; export default { materialsUploadUpdated: { type: materialsUploadStatusType, description: 'Material upload updated', args: { syncId: { type: GraphQLString }, }, resolve: (payload: any) => { return payload; } , subscribe: withFilter(subscribe(MATERIALS_UPLOAD_UPDATED), (payload, variables) => { return payload.syncId === variables.syncId; }), }, };