How to use operator like geater than, less than etc in sorry-cypress graphql api

How to use operator like geater than, less than etc in sorry-cypress graphql api


0

I wanted to filter out specific runs based on createdAt property on sorry-cypress. I was able to add the exact match via parameter. I could not figure out how to give a date range filter in the sorry-cypress graphql query. A greater than and less than operator will help. I could not find any documentation on it too. I would appreciate any help in this regard.

Share

1 Answer
1

Reset to default


0

Sorry-Cypress has some grapql reference hidden in their repo – https://github.com/sorry-cypress/sorry-cypress/blob/master/packages/api/src/schema/schema.graphql

There you can find input Filters that has like field in it, so we can apply the following:

query dateSelectionQuery {
    runs(
        filters: [
            {
                key: "createdAt"
                like: "2023-08"
            }
        ]
    ) {
        runId
    }
}

This query will output all run IDs for August. You can play around with this like field and get an appropriate pattern.

Share

New contributor

Alexey Semirski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



Not the answer you're looking for? Browse other questions tagged

or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *