#use OR in graphQL query
1 messages · Page 1 of 1 (latest)
you can do AND just be using multiple properties on the WHERE property
like this
query{
posts(where:{
title:{
contains:"TechCrunch"
}
content:{
contains:"Since"
}
}){
id
title
content
}
}
but OR is not available
for your example:
clients(
where: {
name: { contains: "a" }
endDate: { gte: "2017-12-31" }
}
) {
id
name
endDate
reasonForEnding
}
Got it, thanks Yuval.
Do you have any plan to develop OR feature?
or you suggest us to develop it ourselves?
And if we want to achieve OR, do you have any workaround solution?
Thanks!
it should be easy to implement with custom code, since prisma already support OR, all you need to do is to expose the parameter to API with the current type...
we didnt implement it yet since it may impacts access permissions when a user may access data that is not theirs.. in our generic case it may be difficult to face that, but in your specific case that should be easy to work around
Hello @still sparrow
I saw our team already opened an issue to support OR query, you can keep track here: https://github.com/amplication/amplication/issues/6653
Feel free to add anything in the comments from your side