Filter the maximum number of posts per page that should be queried. The default is 100 to prevent queries from being exceedingly resource intensive, however individual systems can override this for their specific needs. This filter is intentionally applied AFTER the query_args filter.
- $max_amount (int): Maximum number of items to return for the connection. Too high of a number can cause performance bottlenecks on the server. It’s recommended to keep this lower and encourage clients to paginate requests to get more items.
- $source (mixed): Source passed down from the resolve tree
- $args (array): Array of arguments input in the field as part of the GraphQL query
- $context (AppContext): Object containing app context that gets passed down the resolve tree
- $info (ResolveInfo): Info about fields passed down the resolve tree
This example shows how to filter the max query amount for a specific field name in the Schema. In this case, it filters the connection from the field named
productCategories to have a max amount of 150, instead of the default 100.