Is there way to get the current system date and time using GraphQL (on GraphQL UI)?

Working on a requirement that I need to compare the Sitecore item expiration date(custom field) with the current date.

  • GraphQL is just a query language, not programming. Why do you need current datetime in GraphQL? Why you can not compare field value with javascript new Date()?
    – x3mxray
    May 20 '20 at 12:20
  • I have lot of records in sitecore that I need to send to client. Thought of doing by date filtration.
    – Sun
    May 20 '20 at 12:49
  • 2
    What about using the search filter on GraphQL so that it hits the index and you can apply filtering when using the search filter. You can pass the date as parameter in the graphql May 20 '20 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.