You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I encountered an issue when trying to get the "totalCount" from "paginationInfo" in graphql, while using "page" pagination in API Platform used in Laravel. The following error is displayed:
"extensions": { "debugMessage": "Collection returned by the collection data provider must implement ApiPlatform\\State\\Pagination\\PaginatorInterface to return totalCount field.", "file": "/Users/myUser/folder/projectname/vendor/api-platform/graphql/State/Processor/NormalizeProcessor.php", "line": 212, ... }
How to reproduce
Open the Model file, setup the pagination type :
#[ApiResource(
paginationType: 'page',
)
class MyModel extends Model
{
}
API Platform version(s) affected: 4.0
Description
I encountered an issue when trying to get the "totalCount" from "paginationInfo" in graphql, while using "page" pagination in API Platform used in Laravel. The following error is displayed:
"extensions": { "debugMessage": "Collection returned by the collection data provider must implement ApiPlatform\\State\\Pagination\\PaginatorInterface to return totalCount field.", "file": "/Users/myUser/folder/projectname/vendor/api-platform/graphql/State/Processor/NormalizeProcessor.php", "line": 212, ... }
How to reproduce
#[ApiResource(
paginationType: 'page',
)
class MyModel extends Model
{
}
query getMyModdel ($page: Int) { demandes (page: $page){ collection{ id } paginationInfo{ totalCount } } }
the same issue occurs when trying to get "hasNextPage"
Additional Context
The text was updated successfully, but these errors were encountered: