Skip to content

GraphQL support: Issue on pagination #8056

Description

@vico-gs

Hello there, When using graphQL with api platform 3.0, I noticed something that has changed between 2.6 and 3.0, if have two entities (salad, banana) linked by a ManyToOne relation if the paginationType is page (in salad) and paginationType is cursor (in banana)
When we fetch a banana with simple query:

query 
{
 bananas { totalCount }
}

the cursor pagination works well ! The type of the banana connection is called BananaCursorConnection. BUT when the collection is called inside another query


query
{
 salad
 {
  bananas
  {
   totalCount
  }
 }
}

It will not work and return the error that totalCount is not a correct attribute.
Actually it seems that the type of the bananas has strangely turned into BananaPageConnection forced by the primary entity called.

I tried to force the type by using a TypeConverter which returned me a BananaCursorConnectionPageConnection ....

Is it a correct behavior for api_platofrm 3.0 or did I miss a configuration somewhere ?
Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions