Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
withFilter(
function(self: ClientController) {
return self.pubsub.asyncIterator('listenForChanges');
},
function(global, unused, payload, context) {
const isCorrectLength = context.clientid.length + context.clientid.length;
if (isCorrectLength === 100 && payload.clientId === context.clientid) {
return true;
}
return false;
}
)
)
@Subscription({
clientId: {
type: new GraphQLNonNull(GraphQLString)
}
})
async listenForChanges(views: ConfigViews) {
return this.getViewsConfig(views);
}
getViewsConfig(views?: ConfigViews) {
const config = Container.get('main-config-compiled');
return {
components: config.$components,
views: viewsToArray(views || config.$views),
schema: printSchema(Container.get(BootstrapService).schema)
};
}
@Type(ClientType)