for example: creation date
# prisma-whats-new
j
for example: creation date
m
something like this :
Copy code
query {
  allPosts(filter: {
    createdAt_gt: "2017-09-26T22:34:38.000Z"
  }) {
    id
    title
    published
  }
}
j
thanks 🦜
πŸ™‚ 1
a
Nice to know: these date value filters also support partial dates (as specified in ISO-8601 (https://en.wikipedia.org/wiki/ISO_8601)), this also works:
Copy code
query {
  allPosts(filter: {
    createdAt_gt: "2017-09"
  }) {
    id
    title
    published
  }
}
Copy code
query {
  allPosts(filter: {
    createdAt_gt: "2017"
  }) {
    id
    title
    published
  }
}
Etc.
😍 2
m
thanks @agartha
😎 1
j
I have this data createdAt 22/9/2017 171911 22/9/2017 132735 22/9/2017 113358 21/9/2017 211928 I have tried this query:
Copy code
query {
  allAdverts(filter: {
        createdAt_gte: "2017-09-22"
    }) {
    id
    content
    createdAt
  }
}
however it returns four data in the array:
Copy code
{
  "data": {
    "allAdverts": [
      {
        "id": "cj7v9czligs6l0132j6784v3i",
        "content": "Reparacion de Lavadoras Secadoras y refrigeradores a domicilio, amplia experiencia Presupuesto Gratis,  usamos refacciones nuevas y Originales",
        "createdAt": "2017-09-22T02:19:28.000Z"
      },
      {
        "id": "cj7w3vvr228a4019686n4bdpf",
        "content": "Solicito personal de limpieza, sexo indistinto, pago quincenal y seguro social",
        "createdAt": "2017-09-22T16:33:58.000Z"
      },
      {
        "id": "cj7w7xzsu4cte0138h4tlbfv2",
        "content": "solicito trabajador  ",
        "createdAt": "2017-09-22T18:27:35.000Z"
      },
      {
        "id": "cj7wg7tzr8h990196acye9o0d",
        "content": "Desde casa empaca disfraces halloween $3000 sem. Srita. Luz Oceguera.",
        "createdAt": "2017-09-22T22:19:11.000Z"
      }
    ]
  }
}
I think it should only return me three, do you know why this happens?
a
Depending on your timezone, 21/9/2017 211928 might actually be an edge case. The data displayed in the data browser is shown in your current timezone, queries are using GMT. So that last value might actually be 22/9/2017 021928 GMT for example, which fits your criteria
j
πŸ˜… I understand, my time zone is GMT-5
a
Yes!
j
Thanks @agartha ☺️
😎 1