Skip to main content
Solved

A requisição Graphql não retorna todos os cards do pipe

  • March 28, 2023
  • 1 reply
  • 317 views

felipe-leite-matrixenergia
Forum|alt.badge.img

Estou criando uma automação na qual eu preciso pegar todas as informações de todos os cards do pipe, porem a requisição não retorna todos os cards, segue a requisição:

 

 

query MyQuery {
  allCards(pipeId: "302991598") {
    edges {
      node {
        fields {
          name
          value
        }
        current_phase {
          name
        }
      }
    }
  }
}

Best answer by Lais Laudari

Olá @felipe-leite-matrixenergia!
Não são retornados todos os cards pois temos uma paginação. 😊 São 50 cards por pipe ou 30 por fase.
Para pegar todos os cards, você deve primeiro fazer essa query:
  {
    allCards(pipeId: 123456, first: 50) {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        id
      }
    }
  }
}
You will set the 
pageInfo
 attribute and it will return the "
endcursor
", with the endcursor you can see the other cards within that phase, putting it as an argument in the "
after
" command. Example:
E o 
hasNextPage
 vai te mostrar se existem mais páginas. Em seguida, pode usar o ID retornado pelo 
endCursor
 para pegar a próxima página:
{
allCards(pipeId:123456, first:50, after:"WyIyLjI1IiwiMTg1LjAiLDI2ODc1OTNd"){
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
}
}
}
}

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

1 reply

Lais Laudari

Olá @felipe-leite-matrixenergia!
Não são retornados todos os cards pois temos uma paginação. 😊 São 50 cards por pipe ou 30 por fase.
Para pegar todos os cards, você deve primeiro fazer essa query:
  {
    allCards(pipeId: 123456, first: 50) {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        id
      }
    }
  }
}
You will set the 
pageInfo
 attribute and it will return the "
endcursor
", with the endcursor you can see the other cards within that phase, putting it as an argument in the "
after
" command. Example:
E o 
hasNextPage
 vai te mostrar se existem mais páginas. Em seguida, pode usar o ID retornado pelo 
endCursor
 para pegar a próxima página:
{
allCards(pipeId:123456, first:50, after:"WyIyLjI1IiwiMTg1LjAiLDI2ODc1OTNd"){
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
}
}
}
}


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings