Skip to content

Instantly share code, notes, and snippets.

@lindenmelvin
Created February 6, 2020 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lindenmelvin/93b10c641440551c89a73659c3847ce8 to your computer and use it in GitHub Desktop.
Save lindenmelvin/93b10c641440551c89a73659c3847ce8 to your computer and use it in GitHub Desktop.
const posts = require("./posts");
module.exports = {
Query: {
posts: (_parent, _args, context, _info) => {
return posts.filter(post => post.authorId === context.user.id);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment