Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to query between two dates in graphql

I have a problem here regarding Realm queries in GraphQL.

Is it possible to query between two dates in graphql?

This is what I've tried:

query getStudents{
  student(query:"created_datime BETWEEN {'2018-02-24T14:59:43.842Z','2018-02-28T14:59:43.842Z'}"){
    id
    code
    name
    created_datetime
    modified_datetime
    status
  }
}

it occurs an error "Invalid Predicate".

How to query it correctly?

like image 352
Jay Hyber Avatar asked Oct 22 '25 20:10

Jay Hyber


1 Answers

Can you try:

student(query:"created_datime BETWEEN {'2018-02-24@14:59:43:842', '2018-02-28@14:59:43:842'}"){

Notice the @ instead of the T in question.

like image 102
EpicPandaForce Avatar answered Oct 25 '25 11:10

EpicPandaForce



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!