Skip to content

Commit e8ff4ab

Browse files
authored
feat: Deprecate old query and subscription methods (#195)
1 parent f07348c commit e8ff4ab

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- [Key Features](#key-features)
55
- [Getting Started](#getting-started)
66
- [GraphQL Endpoint](#graphql-endpoint)
7+
- [Hosted Example](#hosted-example)
78
- [Examples](#examples)
89
- [Get all Transactions with add\_package messages. Show the creator, package name and path.](#get-all-transactions-with-add_package-messages-show-the-creator-package-name-and-path)
910
- [Subscribe to get all new blocks in real-time](#subscribe-to-get-all-new-blocks-in-real-time)
@@ -118,9 +119,7 @@ The playground includes built-in documentation for available queries, fields, an
118119
119120
```graphql
120121
{
121-
transactions(
122-
filter: { message: {vm_param: {add_package: {}}}}
123-
) {
122+
getTransactions(where: {messages: {value: {MsgAddPackage: {}}}}) {
124123
index
125124
hash
126125
block_height
@@ -146,7 +145,7 @@ The playground includes built-in documentation for available queries, fields, an
146145
147146
```graphql
148147
subscription {
149-
blocks(filter: {}) {
148+
getBlocks(where: {}) {
150149
height
151150
version
152151
chain_id

serve/graph/gen/generate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import (
1414
var queriesInject = `
1515
type Query {
1616
"""
17-
EXPERIMENTAL: Fetches Blocks matching the specified where criteria.
17+
Fetches Blocks matching the specified where criteria.
1818
Incomplete results due to errors return both the partial Blocks and
1919
the associated errors.
2020
"""
2121
getBlocks(where: FilterBlock!, order: BlockOrder): [Block!]
2222
2323
"""
24-
EXPERIMENTAL: Retrieves a list of Transactions that match the given
24+
Retrieves a list of Transactions that match the given
2525
where criteria. If the result is incomplete due to errors, both partial
2626
results and errors are returned.
2727
"""
@@ -30,7 +30,7 @@ type Query {
3030
3131
type Subscription {
3232
"""
33-
EXPERIMENTAL: Subscribes to real-time updates of Transactions that
33+
Subscribes to real-time updates of Transactions that
3434
match the provided filter criteria. This subscription starts immediately
3535
and only includes Transactions added to the blockchain after the subscription
3636
is active.
@@ -46,7 +46,7 @@ type Subscription {
4646
getTransactions(where: FilterTransaction!): Transaction!
4747
4848
"""
49-
EXPERIMENTAL: Subscribes to real-time updates of Blocks that match the provided
49+
Subscribes to real-time updates of Blocks that match the provided
5050
filter criteria. Similar to the Transactions subscription,
5151
this subscription is active immediately upon creation and only includes Blocks
5252
added after the subscription begins.

serve/graph/generated.go

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

serve/graph/schema/query.graphql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ type Query {
55
"""
66
Retrieves a list of Transactions that match the given filter criteria. If the result is incomplete due to errors, both partial results and errors are returned.
77
"""
8-
transactions(filter: TransactionFilter!): [Transaction!]
8+
transactions(filter: TransactionFilter!): [Transaction!] @deprecated(reason: "Use `getTransactions` instead.")
99

1010
"""
1111
Fetches Blocks matching the specified filter criteria. Incomplete results due to errors return both the partial Blocks and the associated errors.
1212
"""
13-
blocks(filter: BlockFilter!): [Block!]
13+
blocks(filter: BlockFilter!): [Block!] @deprecated(reason: "Use `getBlocks` instead.")
1414

1515
"""
1616
Returns the height of the most recently processed Block by the blockchain indexer, indicating the current length of the blockchain.
1717
"""
1818
latestBlockHeight: Int!
1919
}
20+
21+
# Check graph/gen/generate.go to see Query methods using the auto-generated filters
22+

serve/graph/schema/subscription.graphql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Subscription {
1313
Returns:
1414
- Transaction: Each received update is a Transaction object that matches the filter criteria.
1515
"""
16-
transactions(filter: TransactionFilter!): Transaction!
16+
transactions(filter: TransactionFilter!): Transaction! @deprecated(reason: "Use `getTransactions` instead.")
1717

1818
"""
1919
Subscribes to real-time updates of Blocks that match the provided filter criteria. Similar to the Transactions subscription,
@@ -25,5 +25,7 @@ type Subscription {
2525
Returns:
2626
- Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time.
2727
"""
28-
blocks(filter: BlockFilter!): Block!
28+
blocks(filter: BlockFilter!): Block! @deprecated(reason: "Use `getBlocks` instead.")
2929
}
30+
31+
# Check graph/gen/generate.go to see Subscription methods using the auto-generated filters

0 commit comments

Comments
 (0)