Skip to main content

I’m trying to figure out whether it’s possible to formulate a GraphQL query to retrieve more than 50 items

Here’s a sample query which is returning a page of 50 items, when in fact I want all cards

 

query MyQuery {
  cards(pipe_id: "305537187") {
    nodes {
      id
      current_phase {
        name
      }
      fields {
        value
        native_value
        field {
          id
          label
          internal_id
          index_name
          index
        }
      }
    }
  }
}

Hey Marck,

We have pagination  limit. The current limit of cards/records shown is 30 cards per phase and 50 cards per pipe. 

Regards


For paginating, you shoud add in your query:

pageInfo {
endCursor
hasNextPage
}

and use the value of endCursor as after parameter in subsequent queries, while hasNextPage is true

Example:

query MyQuery {
cards(pipe_id: "11111", after: "WyIyMDIzLTA1LTIzIDE3OjEwOjE0LjgyOTE2MzAwMCBVVEMiLCIyLjAiLDcxNTIxMTAzNl0") {
nodes {
id
current_phase {
name
}
fields {
value
native_value
field {
id
label
internal_id
index_name
index
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}

 

See more details at: https://graphql.org/learn/pagination/#pagination-and-edges


Reply