Link to WPGraphQL on Github
Link to WPGraphQL on WordPress.org


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.


  • $query_args (array): Array of query_args
  • $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


Filter the max query amount for a specific connection based on field name

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.