Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nested contract resolvers in GQL schema #1675

Merged
merged 5 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Description of the upcoming release here.
- [#1636](https://github.com/FuelLabs/fuel-core/pull/1636): Add more docs to GraphQL DAP API.

#### Breaking
- [#1675](https://github.com/FuelLabs/fuel-core/pull/1675): Simplify GQL schema by disabling contract resolvers in most cases, and just return a ContractId scalar instead.
- [#1658](https://github.com/FuelLabs/fuel-core/pull/1658): Receipts are part of the transaction status.
Removed `reason` from the `TransactionExecutionResult::Failed`. It can be calculated based on the program state and receipts.
Also, it is not possible to fetch `receipts` from the `Transaction` directly anymore. Instead, you need to fetch `status` and its receipts.
Expand Down
13 changes: 8 additions & 5 deletions crates/client/assets/schema.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ input ContractBalanceFilterInput {
}

type ContractCreated {
contract: Contract!
contract: ContractId!
stateRoot: Bytes32!
}

Expand Down Expand Up @@ -508,7 +508,7 @@ type InputContract {
balanceRoot: Bytes32!
stateRoot: Bytes32!
txPointer: TxPointer!
contract: Contract!
contractId: ContractId!
}

type InputMessage {
Expand Down Expand Up @@ -826,10 +826,10 @@ type Query {
}

type Receipt {
contract: Contract
id: ContractId
pc: U64
is: U64
to: Contract
to: ContractId
toAddress: Address
amount: U64
assetId: AssetId
Expand All @@ -852,6 +852,9 @@ type Receipt {
sender: Address
recipient: Address
nonce: Nonce
"""
Set in the case of a Panic receipt to indicate a missing contract input id
"""
contractId: ContractId
subId: Bytes32
}
Expand Down Expand Up @@ -957,7 +960,7 @@ scalar Tai64Timestamp
type Transaction {
id: TransactionId!
inputAssetIds: [AssetId!]
inputContracts: [Contract!]
inputContracts: [ContractId!]
inputContract: InputContract
policies: Policies
gasPrice: U64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ mutation($txs: [HexString!]!, $utxoValidation: Boolean) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -31,9 +29,7 @@ mutation($txs: [HexString!]!, $utxoValidation: Boolean) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand All @@ -59,9 +55,7 @@ mutation($txs: [HexString!]!, $utxoValidation: Boolean) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -71,9 +65,7 @@ mutation($txs: [HexString!]!, $utxoValidation: Boolean) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ query($id: TransactionId!) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -39,9 +37,7 @@ query($id: TransactionId!) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down Expand Up @@ -76,9 +72,7 @@ query($id: TransactionId!) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -88,9 +82,7 @@ query($id: TransactionId!) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ query($owner: Address!, $after: String, $before: String, $first: Int, $last: Int
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -42,9 +40,7 @@ query($owner: Address!, $after: String, $before: String, $first: Int, $last: Int
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down Expand Up @@ -79,9 +75,7 @@ query($owner: Address!, $after: String, $before: String, $first: Int, $last: Int
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -91,9 +85,7 @@ query($owner: Address!, $after: String, $before: String, $first: Int, $last: Int
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ query($after: String, $before: String, $first: Int, $last: Int) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -42,9 +40,7 @@ query($after: String, $before: String, $first: Int, $last: Int) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down Expand Up @@ -79,9 +75,7 @@ query($after: String, $before: String, $first: Int, $last: Int) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -91,9 +85,7 @@ query($after: String, $before: String, $first: Int, $last: Int) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ query($id: TransactionId!) {
id
txPointer
inputAssetIds
inputContracts {
id
}
inputContracts
inputContract {
utxoId
balanceRoot
stateRoot
txPointer
contract {
id
}
contractId
}
inputs {
__typename
Expand All @@ -39,9 +35,7 @@ query($id: TransactionId!) {
balanceRoot
stateRoot
txPointer
contract {
id
}
contractId
}
... on InputMessage {
sender
Expand Down Expand Up @@ -81,9 +75,7 @@ query($id: TransactionId!) {
assetId
}
... on ContractCreated {
contract {
id
}
contract
stateRoot
}
}
Expand Down Expand Up @@ -117,9 +109,7 @@ query($id: TransactionId!) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -129,9 +119,7 @@ query($id: TransactionId!) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down Expand Up @@ -166,9 +154,7 @@ query($id: TransactionId!) {
assetId
gas
digest
contract {
id
}
id
is
pc
ptr
Expand All @@ -178,9 +164,7 @@ query($id: TransactionId!) {
rd
reason
receiptType
to {
id
}
to
toAddress
val
len
Expand Down
Loading
Loading