@@ -69,7 +69,7 @@ public function __construct( $source, array $args, AppContext $context, ResolveI
6969 /**
7070 * {@inheritDoc}
7171 */
72- public function get_loader_name () {
72+ protected function loader_name (): string {
7373 return 'post ' ;
7474 }
7575
@@ -149,8 +149,7 @@ public function get_query_args() {
149149 /**
150150 * Prepare for later use
151151 */
152- $ last = ! empty ( $ this ->args ['last ' ] ) ? $ this ->args ['last ' ] : null ;
153- $ first = ! empty ( $ this ->args ['first ' ] ) ? $ this ->args ['first ' ] : null ;
152+ $ last = ! empty ( $ this ->args ['last ' ] ) ? $ this ->args ['last ' ] : null ;
154153
155154 $ query_args = [];
156155 /**
@@ -176,10 +175,10 @@ public function get_query_args() {
176175 /**
177176 * Set posts_per_page the highest value of $first and $last, with a (filterable) max of 100
178177 */
179- $ query_args ['posts_per_page ' ] = $ this ->one_to_one ? 1 : min ( max ( absint ( $ first ), absint ( $ last ), 10 ), $ this ->query_amount ) + 1 ;
178+ $ query_args ['posts_per_page ' ] = $ this ->one_to_one ? 1 : $ this ->get_query_amount ( ) + 1 ;
180179
181180 // set the graphql cursor args
182- $ query_args ['graphql_cursor_compare ' ] = ( ! empty ( $ last ) ) ? '> ' : '< ' ;
181+ $ query_args ['graphql_cursor_compare ' ] = ! empty ( $ last ) ? '> ' : '< ' ;
183182 $ query_args ['graphql_after_cursor ' ] = $ this ->get_after_offset ();
184183 $ query_args ['graphql_before_cursor ' ] = $ this ->get_before_offset ();
185184
@@ -533,7 +532,7 @@ static function ( $status ) use ( $post_type_objects ) {
533532 * {@inheritDoc}
534533 */
535534 public function get_args (): array {
536- $ args = $ this ->args ;
535+ $ args = $ this ->get_unfiltered_args () ;
537536
538537 if ( ! empty ( $ args ['where ' ] ) ) {
539538 // Ensure all IDs are converted to database IDs.
@@ -580,7 +579,7 @@ static function ( $id ) {
580579 *
581580 * @since 1.11.0
582581 */
583- return apply_filters ( 'graphql_post_object_connection_args ' , $ args , $ this , $ this ->args );
582+ return apply_filters ( 'graphql_post_object_connection_args ' , $ args , $ this , $ this ->get_unfiltered_args () );
584583 }
585584
586585 /**
0 commit comments