Skip to content

Commit 2946073

Browse files
authored
fix: require immutable flag on entities (#1994)
1 parent c9fe1c4 commit 2946073

File tree

58 files changed

+221
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+221
-69
lines changed

.changeset/tangy-pants-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphprotocol/graph-cli': minor
3+
---
4+
5+
require immutable flag on entities

examples/arweave-blocks-transactions/schema.graphql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type Block @entity {
1+
type Block @entity(immutable: true) {
22
id: ID!
33

44
timestamp: BigInt!
@@ -22,7 +22,7 @@ type Block @entity {
2222
poa: Poa
2323
}
2424

25-
type Transaction @entity {
25+
type Transaction @entity(immutable: true) {
2626
id: ID!
2727

2828
block: Block!
@@ -39,7 +39,7 @@ type Transaction @entity {
3939
reward: Bytes!
4040
}
4141

42-
type Poa @entity {
42+
type Poa @entity(immutable: true) {
4343
id: ID!
4444

4545
option: String!
@@ -48,7 +48,7 @@ type Poa @entity {
4848
chunk: Bytes!
4949
}
5050

51-
type Tag @entity {
51+
type Tag @entity(immutable: true) {
5252
id: ID!
5353

5454
name: Bytes!

examples/cosmos-block-filtering/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type Block @entity {
1+
type Block @entity(immutable: true) {
22
id: ID!
33
number: BigInt
44
timestamp: BigInt

examples/cosmos-osmosis-token-swaps/schema.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
type Token @entity {
1+
type Token @entity(immutable: true) {
22
id: ID!
33
amount: String
44
denom: String
55
}
66

7-
type TokenSwap @entity {
7+
type TokenSwap @entity(immutable: true) {
88
id: ID!
99
sender: String
1010
poolId: String

examples/cosmos-validator-delegations/schema.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
type Delegation @entity {
1+
type Delegation @entity(immutable: true) {
22
id: ID!
33
delegatorAddress: String
44
validatorAddress: String
55
amount: Coin
66
}
77

8-
type Coin @entity {
8+
type Coin @entity(immutable: true) {
99
id: ID!
1010
denom: String
1111
amount: String

examples/cosmos-validator-rewards/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type Reward @entity {
1+
type Reward @entity(immutable: true) {
22
id: ID!
33
amount: String
44
validator: String

examples/ethereum-basic-event-handlers/schema.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
type NewGravatar @entity {
1+
type NewGravatar @entity(immutable: false) {
22
id: ID!
33
owner: Bytes!
44
displayName: String!
55
imageUrl: String!
66
}
77

8-
type UpdatedGravatar @entity {
8+
type UpdatedGravatar @entity(immutable: false) {
99
id: ID!
1010
owner: Bytes!
1111
displayName: String!

examples/ethereum-gravatar/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type Gravatar @entity {
1+
type Gravatar @entity(immutable: false) {
22
id: ID!
33
owner: Bytes!
44
displayName: String!

examples/example-subgraph/schema.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type ExampleEntity @entity {
1+
type ExampleEntity @entity(immutable: false) {
22
id: ID!
33

44
optionalBoolean: Boolean
@@ -32,6 +32,6 @@ type ExampleEntity @entity {
3232
requiredReferenceList: [OtherEntity!]!
3333
}
3434

35-
type OtherEntity @entity {
35+
type OtherEntity @entity(immutable: true) {
3636
id: ID!
3737
}

examples/near-blocks/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type BlockEvent @entity {
1+
type BlockEvent @entity(immutable: true) {
22
id: ID!
33
number: BigInt
44
hash: Bytes

0 commit comments

Comments
 (0)