is it possible to use query variables in a filter?
# prisma-whats-new
w
is it possible to use query variables in a filter?
👍 1
j
@wallslide I think you can do it with a fat arrow on the constructor in a way similar to how I am using a route on the URL (/product/id) to filter this query: const ProductOrderPageWithData = graphql(FeedQuery, { options: (props) => ({ variables: { what: props.params.productId } }), })(ProductOrderPage) - does that help?
w
I'm wondering if I pass an array in to
variables: {allowableStatuses}
if that array will be used correctly within the query
in a filter
I'm guessing probably, but since graphcool is down right now I can't test it 🙂
j
haha, that's why I was taking a swing at an answer, since i'm patiently hoping it will re-appear myself 🙂
👍 1
w
Copy code
query ($userId: ID!, $allowableStatuses: [EVENT_STATUS!]!){
  User(id: $userId) {
    team {
      events(filter: {
        status_in: $allowableStatuses
       }) {
        id,
        title,
        locationName,
        eventDateTime,
      }
    }
  } 
}
basically, will that work
j
yeah, i'm not sure of that one
n
yes it will
you can also define a variable for the whole filter object
👍 1
w
wow, interesting