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