Remote data troubleshooting
#Known issues and tips
If you work with Remote Sources and you query a lot of entries at the same time, make sure to use sensible pagination limits within Hygraph, so requests to a third-party API are not rate limited or blocked.
When defining a custom type, you can use all the default GraphQL Scalars such as String, Int, Float, Boolean, ID and additionally Json. !
can be used to indicate a field not being nullable, [Type]
will indicate a list (array). More info on the object types and fields can be found here: https://graphql.org/learn/schema/
#Refreshing a GraphQL Remote Source
If something changes on your GraphQL API - i.e., adding or removing fields, or changing types - you can refresh the Remote Source.
Refetch remote schema
To do this, navigate to the GraphQL Remote Source you want to refresh, click on the context menu, then click on Refetch Remote Schema
.
This sends the new introspection query through the API, and once it goes through successfully, you can use the new fields.
If there is an error happening on refetching, please check the Query
section of your Remote Source configuration screen. Make sure that your remote fields are not using a type that's been updated or removed, and that the return type is not using it either.
Our documentation on Adding remote data to your model covers introspection queries.
This issue can be avoided by working on additive changes.
#Error querying remote fields
Irrespective of the model you selected, the default behavior for errors in querying Remote Fields is that the query to Hygraph will return successfully but with a null
value for the Remote Field and an error message to indicate the Remote Field could not be queried. If the value of the Remote Field is critical for the proper functioning of the front-end application, it's possible to mark the Remote Field as required
. With this setting enabled, the whole query to Hygraph will return an error if the Remote Field does not provide a successful response.
Error querying remote fields