Just ran into same issue.
It looks like compareAtPriceRange was added in API version 2020-04.
Updating the API version in my graphQl endpoint to 2020-07 fixed this for me.
You can view here how the field is shown when you are in 2020-04 or later version: https://shopify.dev/docs/storefront-api/reference