-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
type: bugIssue that causes incorrect or unexpected behaviorIssue that causes incorrect or unexpected behavior
Description
Description
When using the $context->get_loader( $loaderName )->load_many() method to resolve a field, the nodes are loaded as expected, but the Node IDs are not being tracked properly in the QueryAnalyzer.
Steps to reproduce
- Add the following code (adjusting as necessary to reflect your dataset)
add_action( 'graphql_register_types', function() {
register_graphql_field( 'RootQuery', 'testLoadmany', [
'type' => [ 'list_of' => 'Post' ],
'resolve' => function( $source, $args, $context, $info ) {
$post_ids = [ 2641, 2644 ];
return $context->get_loader( 'post' )->load_many( $post_ids );
}
] );
} );- With WPGraphQL Debug mode enabled, execute the following query:
query TestLoadMany {
testLoadmany {
id
title
}
}- Examine the
extensions.queryAnalyzer.keysoutput in the response
Expectation
The Node IDs for the resovled posts should be included in the extensions.queryAnalyzer.keys
Actual
The node IDs are NOT included 🥲
Additional context
The nodes are tracked properly when querying for a single Node:
The nodes are tracked properly when querying for a connection of nodes:
WPGraphQL Version
1.24.0
WordPress Version
6.5.2
PHP Version
8.2
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have disabled ALL plugins except for WPGraphQL.
- Yes
- My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
Metadata
Metadata
Assignees
Labels
type: bugIssue that causes incorrect or unexpected behaviorIssue that causes incorrect or unexpected behavior
Type
Projects
Status
✅ Done


