Why is my GQL function getting called repeatedly? [closed]

Why is my GQL function getting called repeatedly? [closed]


0

I am now using React and Apollo GQL for front-end development.
There is one issue for fetching data using GQL.
When rendering the page, the data fetching query should be called once but it is repeating its calling and return undefined.
But If I try this query with Postman, it exactly works returning the expecting data.

I am suspecting this is because the data don’t have ID.
Please let me know if you have any solutions.

Sharing some of code.

query GetFleetCIIMonthlyRatings($startDate: DateTime!, $endDate: DateTime!) {
   fleet {
       ciiMonthlyRatings(startDate: $startDate, endDate: $endDate) {
           month
           year
           actual
           ratingCount {
               a
               b
               c
               d
               e
           }
        }
    }
}

I want to prevent recursive call of this GQL function and get the data.

New contributor

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


Load 4 more related questions


Show fewer related questions

0

Leave a Reply

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