APIs & Integrations

LSeth
Member | Platinum Partner
Member | Platinum Partner

Graphiql Filter by Current Date

Hello. I have a custom object that has a date property. In the graphiql query can I filter by that date property to only show records that have a date newer than the current date? The only way I have been able to filter in the graphiql playground is by setting a date in ISO 8601 format. I was hoping there is a way to get the current to filter from. Thanks.

4 Replies 4
LSeth
Member | Platinum Partner
Member | Platinum Partner

Graphiql Filter by Current Date

@Jaycee_Lewis thanks for the response. Do you know of a way to do the conversion outside the query? I am not sure if this would be done within the graphiql file itself or in the page template that has the graphiql file attached to it. 

0 Upvotes
GRajput
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Graphiql Filter by Current Date

Hi @LSeth 

 

As of now, there is no direct date filtering option available. What you can do here is you could generate the current date in your application code and pass it into the GraphQL query as a variable. This would allow you to always filter by a date newer than the current date.

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes
LSeth
Member | Platinum Partner
Member | Platinum Partner

Graphiql Filter by Current Date

Is there a way to get a variable from the page template that the Graphql file is attached to and use it in the Graphql file for the query?

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Graphiql Filter by Current Date

Hey, @LSeth  👋 Based on my understating of the documentation, GraphQL doesn't offer dynamic date generation inside the query itself. As you noted, you'll need to convert the date into ISO8601 outside the query and then use it to get the result you are after.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes