I’m using apollo, wondering if someone could point...
# prisma-whats-new
k
I’m using apollo, wondering if someone could point me toward an example of using a prop that my component receives, and passing that into the graphql query.
Nevermind, found you can do this:
Copy code
export default compose(
  graphql(QUERY, {
    name: 'myKey',
    options: (ownProps) => ({ variables: { id: ownProps.id } }),
  }),
)(MyComp);
a
const allVideosQuery = gql` query($language: String!, $userId: ID!, $first: Int, $after: String) { allVideos(first: $first, after: $after, orderBy: uploadedAt_DESC, filter: { author: { id_not: $userId } }) { id } } } `;
It will automatically take it from your props. so you need to pass to your component the language and userId props , others are optional