InfiniteQuery
This component wraps the InfiniteList component and provides a simple interface for rendering an infinitely-scrollable list of results from a GraphQL backend.
Properties
query
- required - The GraphQL query to run.variables
- An object of variables to pass to the query.renderItem
- required - The function called to render each item.queryPath
- required - The dot-separated path to the leaf containingthe
edges
listProps
- An object of properties to pass to the list.first
- The number of items to fetch first. Defaults to 16.compact
- See InfiniteListshowNoMore
- See InfiniteListuseWindow
- See InfiniteListscrollProps
- See InfiniteList
Notes
When providing the query
parameter, it must have support for the following variables, or the pagination will have no effect on your query:
first
- The first number of results to collect. Based on GraphQL Relay.after
- The cursor to fetch results after. Based on GraphQL Relay.
Any other variables you require in the query can be passed using the variables
property.
Example
Last updated