https://prefect.io logo
Title
m

Mansour Zayer

10/28/2022, 4:01 PM
Hello. Prefect 1. Is there a way in a graphql query to sort nulls last like:
order by column_name nulls last
? I have this line
order_by: {start_time: desc}
in my query. More context in comment
1
In Prefect 1, I have a graphql query that returns the response in the screenshot. The problem is that the flow_run start_time is
null
(maybe some bug in prefect 1 cloud), and in my request, I'm ordering by start_date (
order_by: {start_time: desc}
), and I always get this null as the first one, which is breaking my code. I want null to be last, not first.
k

Kalise Richmond

10/28/2022, 9:24 PM
Have you tried to filter out the nulls? You could potentially create two qraphql calls, one with the nulls filtered out and one filtering just for the nulls and then concat the data with the nulls at the end before processing.