Skip to content

Pagination on content types ! determining length !? #2

@drupalshift

Description

@drupalshift

Hi there , i am trying to get nodes from my article content type , i am wondering how can i use offset and limit since i can't get length of my entity !?

{
    nodeQuery(limit:2 ,offset:4) {
    ... on EntityNodeArticle {
      vid,
      articleImage {
        ... on FieldItemNodeFieldArticleImage {
          entity {
            uri
          }
        }
        alt
        title
        width
        height
      }
    }
  }
}

How can i get length of EntityNodeArticle ? so i can use it for pagination with limit and offset !


Another question is am i able to use pagination in graphql display views , i mean if i create a view and limiting pagination to show 1 node , how can i pass the offset in graphql !

{
   frontpageGraphql1 {
    ...on EntityNodeArticle {
      title
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions