I noticed that the LocalTime type in the schema.graphql file for Shopify Functions is designed primarily for comparing given times and dates. However, it does not include a direct field or method to retrieve the current time.
This limitation poses challenges in scenarios where real-time operations or validations depend on the current time. Adding a new field to the LocalTime type to fetch the current time directly would greatly enhance functionality and simplify use cases like time-based logic in custom Shopify Functions.
I’ve connected with our product team on this and it appears that this limitation is intentional. All inputs must be provided to the function - it cannot pull anything from its environment, such as the current time, as this would mean that the same input could produce different outputs.
@NickWesselman : resolution to the current second would be nice; but i could also live with minute. the current ability to be able to query if the current time is after a specific date/time based on the static graphql query seems…not super useful, seeing as the graphql queries can’t be generated dynamically.
access to the current unix epoch timestamp would be great.