Skip to content

Commit a16b5bb

Browse files
a-zorinailyar
authored andcommitted
update guides for new API
1 parent bdb8ef5 commit a16b5bb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/develop/graphql-pagination.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ While it might seem more convenient and simple, this is a sub-optimal practice.
88

99
[GraphQL Blockchain API](https://docs.evercloud.dev/reference/graphql-api/blockchain) was developed for this exact reason - to provide a reliable way of blockchain data pagination and prevent any potential data inconsistencies regardless of network load.
1010

11+
**Note**: With [GraphQL API 1.0](https://docs.evercloud.dev/reference/breaking-changes/migration-guides/graphql-api-1.0-migration) update by default Blockchain API provides only data for the past 7 days. For use cases where earlier data is needed make sure to use the 'archive: true' flag in blockchain query filters, as shown in the samples below. Do not however use it, if archive data isn't required, as it will generate unnecessary load.
12+
1113
**Note**: Query Collections are a supported instrument and will remain so. However, they are intended and optimized primarily for tasks that are not critically dependent on data completeness, such as analytics.
1214

1315
## Blocks Pagination with Blockchain API
@@ -28,6 +30,7 @@ query {
2830
end: 2670661
2931
}
3032
workchain: 0
33+
archive: true
3134
) {
3235
edges {
3336
node {
@@ -115,6 +118,7 @@ query {
115118
after: "52899360053806ff11d"
116119
first: 10
117120
workchain: 0
121+
archive: true
118122
) {
119123
edges {
120124
node {
@@ -205,6 +209,7 @@ query {
205209
end: 2670661
206210
}
207211
workchain: 0
212+
archive: true
208213
) {
209214
edges {
210215
node {
@@ -278,6 +283,7 @@ query {
278283
after: "528be5b005381da811c00"
279284
first: 10
280285
workchain: 0
286+
archive: true
281287
) {
282288
edges {
283289
node {

src/develop/recipes/backend-integration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ In these samples JS SDK is used. [Bindings](https://docs.everos.dev/ever-sdk/#co
580580

581581
The [pagination](https://github.com/tonlabs/sdk-samples/tree/master/demo/paginate-transactions) sample queries and displays transactions in workchain 0 (workchain where simple transfers happen, -1 workchain is masterchain where you can find service transactions and validator transactions) from the beginning. We can get all the transaction and filter by account addresses on the backend side.
582582

583+
**Note**: By default the Blockchain API queries, such as the one used here provide only data from the past 7 days. To retrieve older data, make sure to use the `archive: true` flag, as shown in the sample:
584+
583585
```typescript
584586
async function main(client: TonClient) {
585587
// In this example, we want the query to return 2 items per page.
@@ -595,6 +597,7 @@ The [pagination](https://github.com/tonlabs/sdk-samples/tree/master/demo/paginat
595597
blockchain {
596598
transactions(
597599
workchain: 0
600+
archive: true
598601
first: $count
599602
after: $cursor
600603
) {

0 commit comments

Comments
 (0)