UNPKG

uzen

Version:

General-purpose GraphQL subscription server library

15 lines (14 loc) 500 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const graphUtils_1 = require("../../../utils/graphUtils"); const resolvers = { Subscription: { ntCrud: { subscribe: async (_, { topic }, { authorization, pubsub }) => { const auth = (0, graphUtils_1.isAuth)(authorization); return pubsub.subscribe(graphUtils_1.TOPICS.ntCrud(`${topic}.${auth.tenant}`)); } }, }, }; exports.default = resolvers;