Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then((json) => {
const { data } = json
if (!data) {
return alfy.log(json.errors ? json.errors : 'Unknown GraphQL Error')
}
const results = alfy
.inputMatches(data.viewer.todos, 'body')
.map((todo) => {
return {
title: todo.body,
subtitle: 'Pending todo',
arg: todo.id,
icon: {
type: 'png',
path: path.resolve(__dirname, './wipfred-todo.png')
}
}
})
alfy.output(results)
})
.catch(error => {
alfy.log(error);
});