Skip to content

Instantly share code, notes, and snippets.

@richardgrantserverless
Created March 8, 2022 20:35
User: {
tweets: obj =>
knex
.select('*')
.from('Tweets')
.leftJoin('Users', 'Tweets.user_id', 'Users.user_id')
.where('handle', obj.handle)
.then(posts => {
if (!posts) {
throw new Error('User not found');
}
tweets = { items: posts };
return tweets;
}),
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment