From f3103d8086b3966ebd5461339c3fc191c90c7848 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Tue, 10 Sep 2024 10:28:07 +0200 Subject: [PATCH 01/12] Implement generic filters Added new query API implementing a first version of generic filters. Some things are missing: - No subscriptions yet, almost there - No filters for multi type fields like messages, still thinking about how to implement the API to make it user friendly. Please, any feedback is welcome! Signed-off-by: Antonio Navarro Perez --- go.mod | 1 + go.sum | 2 + serve/graph/all.resolvers.go | 277 ++ serve/graph/gen/generate.go | 42 + serve/graph/generated.go | 4673 ++++++++++++++++-- serve/graph/model/filter_methods.go | 1070 ++++ serve/graph/model/models_gen.go | 317 ++ serve/graph/query.resolvers.go | 128 - serve/graph/resolver.go | 2 +- serve/graph/schema/types/block.graphql | 41 +- serve/graph/schema/types/transaction.graphql | 42 +- serve/graph/setup.go | 13 +- serve/graph/subscription.resolvers.go | 39 - 13 files changed, 6063 insertions(+), 584 deletions(-) create mode 100644 serve/graph/all.resolvers.go create mode 100644 serve/graph/gen/generate.go create mode 100644 serve/graph/model/filter_methods.go delete mode 100644 serve/graph/query.resolvers.go delete mode 100644 serve/graph/subscription.resolvers.go diff --git a/go.mod b/go.mod index 419f0153..55f297e3 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.22.7 require ( github.com/99designs/gqlgen v0.17.54 + github.com/ajnavarro/gqlfiltergen v0.0.0-20240910174730-98492f66692d github.com/cockroachdb/pebble v1.1.2 github.com/gnolang/gno v0.2.0 github.com/go-chi/chi/v5 v5.1.0 diff --git a/go.sum b/go.sum index ae3dea94..9912b854 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240910174730-98492f66692d h1:+f629awnLtFHMIPN7Eqwzr5aX738brTJ7tnckUJszsw= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240910174730-98492f66692d/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go new file mode 100644 index 00000000..5b33b7a7 --- /dev/null +++ b/serve/graph/all.resolvers.go @@ -0,0 +1,277 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.49 + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "github.com/vektah/gqlparser/v2/gqlerror" + + "github.com/gnolang/tx-indexer/serve/graph/model" + "github.com/gnolang/tx-indexer/types" +) + +// Transactions is the resolver for the transactions field. +func (r *queryResolver) Transactions(ctx context.Context, filter model.TransactionFilter) ([]*model.Transaction, error) { + if filter.Hash != nil { + tx, err := r.store.GetTxByHash(*filter.Hash) + if err != nil { + return nil, gqlerror.Wrap(err) + } + return []*model.Transaction{model.NewTransaction(tx)}, nil + } + + it, err := r. + store. + TxIterator( + uint64(deref(filter.FromBlockHeight)), + uint64(deref(filter.ToBlockHeight)), + uint32(deref(filter.FromIndex)), + uint32(deref(filter.ToIndex)), + ) + if err != nil { + return nil, gqlerror.Wrap(err) + } + defer it.Close() + + var out []*model.Transaction + i := 0 + for { + if i == maxElementsPerQuery { + graphql.AddErrorf(ctx, "max elements per query reached (%d)", maxElementsPerQuery) + return out, nil + } + + if !it.Next() { + return out, it.Error() + } + + select { + case <-ctx.Done(): + graphql.AddError(ctx, ctx.Err()) + return out, nil + default: + t, err := it.Value() + if err != nil { + graphql.AddError(ctx, err) + return out, nil + } + + transaction := model.NewTransaction(t) + if !FilteredTransactionBy(transaction, filter) { + continue + } + out = append(out, transaction) + i++ + } + } +} + +// Blocks is the resolver for the blocks field. +func (r *queryResolver) Blocks(ctx context.Context, filter model.BlockFilter) ([]*model.Block, error) { + it, err := r. + store. + BlockIterator( + uint64(deref(filter.FromHeight)), + uint64(deref(filter.ToHeight)), + ) + if err != nil { + return nil, gqlerror.Wrap(err) + } + defer it.Close() + + var out []*model.Block + + i := 0 + for { + if i == maxElementsPerQuery { + graphql.AddErrorf(ctx, "max elements per query reached (%d)", maxElementsPerQuery) + return out, nil + } + + if !it.Next() { + return out, it.Error() + } + + select { + case <-ctx.Done(): + graphql.AddError(ctx, ctx.Err()) + return out, nil + default: + b, err := it.Value() + if err != nil { + graphql.AddError(ctx, err) + return out, nil + } + + block := model.NewBlock(b) + if !FilteredBlockBy(block, filter) { + continue + } + + out = append(out, block) + i++ + } + } +} + +// LatestBlockHeight is the resolver for the latestBlockHeight field. +func (r *queryResolver) LatestBlockHeight(ctx context.Context) (int, error) { + h, err := r.store.GetLatestHeight() + return int(h), err +} + +// GetBlocks is the resolver for the getBlocks field. +func (r *queryResolver) GetBlocks(ctx context.Context, where model.FilterBlock) ([]*model.Block, error) { + fromh, toh := where.MinMaxHeight() + + it, err := r. + store. + BlockIterator( + uint64(deref(fromh)), + uint64(deref(toh)), + ) + if err != nil { + return nil, gqlerror.Wrap(err) + } + defer it.Close() + + var out []*model.Block + + i := 0 + for { + if i == maxElementsPerQuery { + graphql.AddErrorf(ctx, "max elements per query reached (%d)", maxElementsPerQuery) + return out, nil + } + + if !it.Next() { + return out, it.Error() + } + + select { + case <-ctx.Done(): + graphql.AddError(ctx, ctx.Err()) + return out, nil + default: + b, err := it.Value() + if err != nil { + graphql.AddError(ctx, err) + return out, nil + } + + block := model.NewBlock(b) + + if !where.Eval(block) { + continue + } + + out = append(out, block) + i++ + } + } +} + +// GetTransactions is the resolver for the getTransactions field. +func (r *queryResolver) GetTransactions(ctx context.Context, where model.FilterTransaction) ([]*model.Transaction, error) { + // corner case + if where.Hash.Eq != nil && + len(where.Or) == 0 { + tx, err := r.store.GetTxByHash(*where.Hash.Eq) + if err != nil { + return nil, gqlerror.Wrap(err) + } + + otx := model.NewTransaction(tx) + + // evaluate just in case the user is using any other filter than Eq + if !where.Eval(otx) { + return nil, nil + } + + return []*model.Transaction{otx}, nil + } + + fromh, toh := where.MinMaxBlockHeight() + fromi, toi := where.MinMaxIndex() + + it, err := r. + store. + TxIterator( + uint64(deref(fromh)), + uint64(deref(toh)), + uint32(deref(fromi)), + uint32(deref(toi)), + ) + if err != nil { + return nil, gqlerror.Wrap(err) + } + defer it.Close() + + var out []*model.Transaction + i := 0 + for { + if i == maxElementsPerQuery { + graphql.AddErrorf(ctx, "max elements per query reached (%d)", maxElementsPerQuery) + return out, nil + } + + if !it.Next() { + return out, it.Error() + } + + select { + case <-ctx.Done(): + graphql.AddError(ctx, ctx.Err()) + return out, nil + default: + t, err := it.Value() + if err != nil { + graphql.AddError(ctx, err) + return out, nil + } + + transaction := model.NewTransaction(t) + + if !where.Eval(transaction) { + continue + } + out = append(out, transaction) + i++ + } + } +} + +// Transactions is the resolver for the transactions field. +func (r *subscriptionResolver) Transactions(ctx context.Context, filter model.TransactionFilter) (<-chan *model.Transaction, error) { + return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Transaction) { + for _, tx := range nb.Results { + transaction := model.NewTransaction(tx) + if FilteredTransactionBy(transaction, filter) { + c <- transaction + } + } + }), nil +} + +// Blocks is the resolver for the blocks field. +func (r *subscriptionResolver) Blocks(ctx context.Context, filter model.BlockFilter) (<-chan *model.Block, error) { + return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Block) { + block := model.NewBlock(nb.Block) + if FilteredBlockBy(block, filter) { + c <- block + } + }), nil +} + +// Query returns QueryResolver implementation. +func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } + +// Subscription returns SubscriptionResolver implementation. +func (r *Resolver) Subscription() SubscriptionResolver { return &subscriptionResolver{r} } + +type queryResolver struct{ *Resolver } +type subscriptionResolver struct{ *Resolver } diff --git a/serve/graph/gen/generate.go b/serve/graph/gen/generate.go new file mode 100644 index 00000000..8e4a8d0b --- /dev/null +++ b/serve/graph/gen/generate.go @@ -0,0 +1,42 @@ +// go:build ignore + +package main + +import ( + "fmt" + "os" + + "github.com/99designs/gqlgen/api" + "github.com/99designs/gqlgen/codegen/config" + "github.com/ajnavarro/gqlfiltergen" +) + +func main() { + cfg, err := config.LoadConfigFromDefaultLocations() + if err != nil { + fmt.Fprintln(os.Stderr, "failed to load config", err.Error()) + os.Exit(2) + } + + err = api.Generate(cfg, + api.AddPlugin(gqlfiltergen.NewPlugin(&gqlfiltergen.Options{ + Queries: []string{ + ` + """ + Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + """ + getBlocks(where: FilterBlock!): [Block!] +`, ` + """ + Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. + """ + getTransactions(where: FilterTransaction!): [Transaction!] + `, + }, + })), + ) + if err != nil { + fmt.Fprintln(os.Stderr, err.Error()) + os.Exit(3) + } +} diff --git a/serve/graph/generated.go b/serve/graph/generated.go index a7ab8e46..dc7d8d7e 100644 --- a/serve/graph/generated.go +++ b/serve/graph/generated.go @@ -5,7 +5,6 @@ package graph import ( "bytes" "context" - "embed" "errors" "fmt" "io" @@ -46,6 +45,7 @@ type ResolverRoot interface { } type DirectiveRoot struct { + Filterable func(ctx context.Context, obj interface{}, next graphql.Resolver, extras []model.FilterableAddons) (res interface{}, err error) } type ComplexityRoot struct { @@ -132,6 +132,8 @@ type ComplexityRoot struct { Query struct { Blocks func(childComplexity int, filter model.BlockFilter) int + GetBlocks func(childComplexity int, where model.FilterBlock) int + GetTransactions func(childComplexity int, where model.FilterTransaction) int LatestBlockHeight func(childComplexity int) int Transactions func(childComplexity int, filter model.TransactionFilter) int } @@ -187,6 +189,8 @@ type QueryResolver interface { Transactions(ctx context.Context, filter model.TransactionFilter) ([]*model.Transaction, error) Blocks(ctx context.Context, filter model.BlockFilter) ([]*model.Block, error) LatestBlockHeight(ctx context.Context) (int, error) + GetBlocks(ctx context.Context, where model.FilterBlock) ([]*model.Block, error) + GetTransactions(ctx context.Context, where model.FilterTransaction) ([]*model.Transaction, error) } type SubscriptionResolver interface { Transactions(ctx context.Context, filter model.TransactionFilter) (<-chan *model.Transaction, error) @@ -560,6 +564,30 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Blocks(childComplexity, args["filter"].(model.BlockFilter)), true + case "Query.getBlocks": + if e.complexity.Query.GetBlocks == nil { + break + } + + args, err := ec.field_Query_getBlocks_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GetBlocks(childComplexity, args["where"].(model.FilterBlock)), true + + case "Query.getTransactions": + if e.complexity.Query.GetTransactions == nil { + break + } + + args, err := ec.field_Query_getTransactions_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GetTransactions(childComplexity, args["where"].(model.FilterTransaction)), true + case "Query.latestBlockHeight": if e.complexity.Query.LatestBlockHeight == nil { break @@ -777,11 +805,27 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputBlockFilter, ec.unmarshalInputEventAttributeInput, ec.unmarshalInputEventInput, + ec.unmarshalInputFilterBlock, + ec.unmarshalInputFilterBlockTransaction, + ec.unmarshalInputFilterBoolean, + ec.unmarshalInputFilterCoin, + ec.unmarshalInputFilterNumber, + ec.unmarshalInputFilterString, + ec.unmarshalInputFilterTime, + ec.unmarshalInputFilterTransaction, + ec.unmarshalInputFilterTransactionMessage, + ec.unmarshalInputFilterTransactionResponse, + ec.unmarshalInputFilterTxFee, ec.unmarshalInputMemFileInput, ec.unmarshalInputMemPackageInput, ec.unmarshalInputMsgAddPackageInput, ec.unmarshalInputMsgCallInput, ec.unmarshalInputMsgRunInput, + ec.unmarshalInputNestedFilterBlockTransaction, + ec.unmarshalInputNestedFilterCoin, + ec.unmarshalInputNestedFilterTransactionMessage, + ec.unmarshalInputNestedFilterTransactionResponse, + ec.unmarshalInputNestedFilterTxFee, ec.unmarshalInputTransactionBankMessageInput, ec.unmarshalInputTransactionFilter, ec.unmarshalInputTransactionMessageInput, @@ -884,25 +928,1330 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil } -//go:embed "schema/query.graphql" "schema/schema.graphql" "schema/subscription.graphql" "schema/filter/block_filter.graphql" "schema/filter/transaction_filter.graphql" "schema/types/block.graphql" "schema/types/transaction.graphql" -var sourcesFS embed.FS - -func sourceData(filename string) string { - data, err := sourcesFS.ReadFile(filename) - if err != nil { - panic(fmt.Sprintf("codegen problem: %s not available", filename)) - } - return string(data) -} - var sources = []*ast.Source{ - {Name: "schema/query.graphql", Input: sourceData("schema/query.graphql"), BuiltIn: false}, - {Name: "schema/schema.graphql", Input: sourceData("schema/schema.graphql"), BuiltIn: false}, - {Name: "schema/subscription.graphql", Input: sourceData("schema/subscription.graphql"), BuiltIn: false}, - {Name: "schema/filter/block_filter.graphql", Input: sourceData("schema/filter/block_filter.graphql"), BuiltIn: false}, - {Name: "schema/filter/transaction_filter.graphql", Input: sourceData("schema/filter/transaction_filter.graphql"), BuiltIn: false}, - {Name: "schema/types/block.graphql", Input: sourceData("schema/types/block.graphql"), BuiltIn: false}, - {Name: "schema/types/transaction.graphql", Input: sourceData("schema/types/transaction.graphql"), BuiltIn: false}, + {Name: "../../all", Input: `directive @filterable( + """ + Add extra functionality to this field apart from the filtering capabilities. + """ + extras: [FilterableAddons!] +) on FIELD_DEFINITION +""" +` + "`" + `AmountInput` + "`" + ` is a range of token quantities to filter by. +""" +input AmountInput { + """ + The minimum quantity of tokens to check for. + """ + from: Int + """ + The maximum quantity of tokens to check for. + """ + to: Int + """ + Filter by token's denomination. + If set to an empty string, it will get an empty value. + """ + denomination: String +} +""" +` + "`" + `BankMsgSend` + "`" + ` is a message with a message router of ` + "`" + `bank` + "`" + ` and a message type of ` + "`" + `send` + "`" + `. +` + "`" + `BankMsgSend` + "`" + ` is the fund transfer tx message. +""" +type BankMsgSend { + """ + the bech32 address of the fund sender. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + from_address: String! + """ + the bech32 address of the fund receiver. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + to_address: String! + """ + the denomination and amount of fund sent (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + amount: String! +} +""" +` + "`" + `BankMsgSendInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `send` + "`" + `. +""" +input BankMsgSendInput { + """ + the bech32 address of the fund sender. + You can filter by the fund sender address. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + from_address: String + """ + the bech32 address of the fund receiver. + You can filter by the fund receiver address. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + to_address: String + """ + the denomination and amount of fund sent (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + amount: AmountInput +} +""" +Represents a blockchain block with various attributes detailing its creation and content. +""" +type Block { + """ + A unique identifier for the block, determined by the blockchain's header. + It is computed as a Merkle tree from the header. + """ + hash: String! @filterable + """ + A unique identifier for the Block determined by its position in the blockchain. + This integer is strictly increasing with each new Block. + """ + height: Int! @filterable(extras: [MINMAX]) + """ + The software version of the node that created this Block, indicating the specific + implementation and versioning of the blockchain protocol used. + """ + version: String! @filterable + """ + An identifier for the specific blockchain network this Block belongs to. Helps in + distinguishing between different networks like mainnet, testnet, etc. + """ + chain_id: String! @filterable + """ + The timestamp at which this Block was proposed and finalized in the blockchain. Represented in UTC. + """ + time: Time! @filterable + """ + The number of transactions this Block belongs to. + """ + num_txs: Int! @filterable + """ + The total number of transactions that have occurred up to this block. + Indicates the total number of transactions that have occurred up to this point, even if there are no transactions in this block. + """ + total_txs: Int! @filterable + """ + The application's version. + """ + app_version: String! @filterable + """ + The last committed block hash. + """ + last_block_hash: String! @filterable + """ + Commit hash from validators from the last block. + """ + last_commit_hash: String! @filterable + """ + Validators for the current block. + """ + validators_hash: String! @filterable + """ + Validators for the next block. + """ + next_validators_hash: String! @filterable + """ + Consensus params for current block. + """ + consensus_hash: String! @filterable + """ + State after txs from the previous block. + """ + app_hash: String! @filterable + """ + Root hash of all results from the txs from the previous block. + """ + last_results_hash: String! @filterable + """ + Encoded data representing the blockchain address of the proposer who submitted this Block. + It is raw and requires decoding to be human-readable. + """ + proposer_address_raw: String! @filterable + """ + txs contains transactions included in the block. + """ + txs: [BlockTransaction]! @filterable +} +""" +Filters for querying Blocks within specified criteria related to their attributes. +""" +input BlockFilter { + """ + Minimum block height from which to start fetching Blocks, inclusive. If unspecified, there is no lower bound. + """ + from_height: Int + """ + Maximum block height up to which Blocks should be fetched, exclusive. If unspecified, there is no upper bound. + """ + to_height: Int + """ + Minimum timestamp from which to start fetching Blocks, inclusive. Blocks created at or after this time will be included. + """ + from_time: Time + """ + Maximum timestamp up to which to fetch Blocks, exclusive. Only Blocks created before this time are included. + """ + to_time: Time +} +""" +Defines a transaction within a block, its execution specifics and content. +""" +type BlockTransaction { + """ + Hash computes the TMHASH hash of the wire encoded transaction. + """ + hash: String! @filterable + """ + Fee information for the transaction. + """ + fee: TxFee! @filterable + """ + ` + "`" + `memo` + "`" + ` are string information stored within a transaction. + ` + "`" + `memo` + "`" + ` can be utilized to find or distinguish transactions. + For example, when trading a specific exchange, you would utilize the memo field of the transaction. + """ + memo: String! @filterable + """ + The payload of the Transaction in a raw format, typically containing the instructions and any data necessary for execution. + """ + content_raw: String! +} +""" +Define the quantity and denomination of a coin. +""" +type Coin { + """ + The amount of coins. + """ + amount: Int! @filterable + """ + The denomination of the coin. + """ + denom: String! @filterable +} +union Event = GnoEvent | UnknownEvent +""" +Transaction event's attribute to filter transaction. +"EventAttributeInput" can be configured as a filter with a event attribute's ` + "`" + `key` + "`" + ` and ` + "`" + `value` + "`" + `. +""" +input EventAttributeInput { + """ + ` + "`" + `key` + "`" + ` is the key of the event attribute. + """ + key: String + """ + ` + "`" + `value` + "`" + ` is the value of the event attribute. + """ + value: String +} +""" +Transaction's event to filter transactions. +"EventInput" can be configured as a filter with a transaction event's ` + "`" + `type` + "`" + ` and ` + "`" + `pkg_path` + "`" + ` and ` + "`" + `func` + "`" + `, and ` + "`" + `attrs` + "`" + `. +""" +input EventInput { + """ + ` + "`" + `type` + "`" + ` is the type of transaction event emitted. + """ + type: String + """ + ` + "`" + `pkg_path` + "`" + ` is the path to the package that emitted the event. + """ + pkg_path: String + """ + ` + "`" + `func` + "`" + ` is the name of the function that emitted the event. + """ + func: String + """ + ` + "`" + `attrs` + "`" + ` filters transactions whose events contain attributes. + ` + "`" + `attrs` + "`" + ` is entered as an array and works exclusively. + ex) ` + "`" + `attrs[0] || attrs[1] || attrs[2]` + "`" + ` + """ + attrs: [EventAttributeInput!] +} +""" +filter for Block objects +""" +input FilterBlock { + """ + logical operator for Block that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterBlock] + """ + logical operator for Block that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterBlock] + """ + logical operator for Block that will reverse conditions. + """ + _not: FilterBlock + """ + filter for hash field. + """ + hash: FilterString + """ + filter for height field. + """ + height: FilterNumber + """ + filter for version field. + """ + version: FilterString + """ + filter for chain_id field. + """ + chain_id: FilterString + """ + filter for time field. + """ + time: FilterTime + """ + filter for num_txs field. + """ + num_txs: FilterNumber + """ + filter for total_txs field. + """ + total_txs: FilterNumber + """ + filter for app_version field. + """ + app_version: FilterString + """ + filter for last_block_hash field. + """ + last_block_hash: FilterString + """ + filter for last_commit_hash field. + """ + last_commit_hash: FilterString + """ + filter for validators_hash field. + """ + validators_hash: FilterString + """ + filter for next_validators_hash field. + """ + next_validators_hash: FilterString + """ + filter for consensus_hash field. + """ + consensus_hash: FilterString + """ + filter for app_hash field. + """ + app_hash: FilterString + """ + filter for last_results_hash field. + """ + last_results_hash: FilterString + """ + filter for proposer_address_raw field. + """ + proposer_address_raw: FilterString + """ + filter for txs field. + """ + txs: NestedFilterBlockTransaction +} +""" +filter for BlockTransaction objects +""" +input FilterBlockTransaction { + """ + logical operator for BlockTransaction that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterBlockTransaction] + """ + logical operator for BlockTransaction that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterBlockTransaction] + """ + logical operator for BlockTransaction that will reverse conditions. + """ + _not: FilterBlockTransaction + """ + filter for hash field. + """ + hash: FilterString + """ + filter for fee field. + """ + fee: NestedFilterTxFee + """ + filter for memo field. + """ + memo: FilterString +} +""" +Filter type for boolean fields. All added filters here are processed as AND operators. +""" +input FilterBoolean { + """ + Filter a boolean field checking if it exists or not. + """ + exists: Boolean + """ + Filter a boolean field checking if it is equals to the specified value. + """ + eq: Boolean +} +""" +filter for Coin objects +""" +input FilterCoin { + """ + logical operator for Coin that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterCoin] + """ + logical operator for Coin that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterCoin] + """ + logical operator for Coin that will reverse conditions. + """ + _not: FilterCoin + """ + filter for amount field. + """ + amount: FilterNumber + """ + filter for denom field. + """ + denom: FilterString +} +""" +Filter type for number fields. All added filters here are processed as AND operators. +""" +input FilterNumber { + """ + Filter a number field checking if it exists or not. + """ + exists: Boolean + """ + Filter a number field checking if it is equals to the specified value. + """ + eq: Int + """ + Filter a number field checking if it is NOT equals to the specified value. + """ + neq: Int + """ + Filter a number field checking if it is greater than the specified value. + """ + gt: Int + """ + Filter a number field checking if it is less than the specified value. + """ + lt: Int +} +""" +Filter type for string fields. It contains a variety of filter types for string types. All added filters here are processed as AND operators. +""" +input FilterString { + """ + Filter a string field checking if it exists or not. + """ + exists: Boolean + """ + Filter a string field checking if it is equals to the specified value. + """ + eq: String + """ + Filter a string field checking if it is NOT equals to the specified value. + """ + neq: String + """ + Filter a string field checking if it is like the specified value. You can use standard Go RegEx expressions here. + """ + like: String + """ + Filter a string field checking if it is NOT like the specified value. You can use standard Go RegEx expressions here. + """ + nlike: String +} +""" +Filter type for time fields. All added filters here are processed as AND operators. +""" +input FilterTime { + """ + Filter a time field checking if it exists or not. + """ + exists: Boolean + """ + Filter a time field checking if it is equals to the specified value. + """ + eq: Time + """ + Filter a time field checking if it is NOT equals to the specified value. + """ + neq: Time + """ + Filter a time field checking if it is before than the specified value. + """ + before: Time + """ + Filter a time field checking if it is after the specified value. + """ + after: Time +} +""" +filter for Transaction objects +""" +input FilterTransaction { + """ + logical operator for Transaction that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterTransaction] + """ + logical operator for Transaction that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterTransaction] + """ + logical operator for Transaction that will reverse conditions. + """ + _not: FilterTransaction + """ + filter for index field. + """ + index: FilterNumber + """ + filter for hash field. + """ + hash: FilterString + """ + filter for success field. + """ + success: FilterBoolean + """ + filter for block_height field. + """ + block_height: FilterNumber + """ + filter for gas_wanted field. + """ + gas_wanted: FilterNumber + """ + filter for gas_used field. + """ + gas_used: FilterNumber + """ + filter for gas_fee field. + """ + gas_fee: NestedFilterCoin + """ + filter for messages field. + """ + messages: NestedFilterTransactionMessage + """ + filter for memo field. + """ + memo: FilterString + """ + filter for response field. + """ + response: NestedFilterTransactionResponse +} +""" +filter for TransactionMessage objects +""" +input FilterTransactionMessage { + """ + logical operator for TransactionMessage that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterTransactionMessage] + """ + logical operator for TransactionMessage that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterTransactionMessage] + """ + logical operator for TransactionMessage that will reverse conditions. + """ + _not: FilterTransactionMessage + """ + filter for typeUrl field. + """ + typeUrl: FilterString + """ + filter for route field. + """ + route: FilterString +} +""" +filter for TransactionResponse objects +""" +input FilterTransactionResponse { + """ + logical operator for TransactionResponse that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterTransactionResponse] + """ + logical operator for TransactionResponse that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterTransactionResponse] + """ + logical operator for TransactionResponse that will reverse conditions. + """ + _not: FilterTransactionResponse + """ + filter for log field. + """ + log: FilterString + """ + filter for info field. + """ + info: FilterString + """ + filter for error field. + """ + error: FilterString + """ + filter for data field. + """ + data: FilterString +} +""" +filter for TxFee objects +""" +input FilterTxFee { + """ + logical operator for TxFee that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterTxFee] + """ + logical operator for TxFee that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterTxFee] + """ + logical operator for TxFee that will reverse conditions. + """ + _not: FilterTxFee + """ + filter for gas_wanted field. + """ + gas_wanted: FilterNumber + """ + filter for gas_fee field. + """ + gas_fee: NestedFilterCoin +} +enum FilterableAddons { + """ + Get minimum and maximum value used on all the filters for this field. + Useful when you need to do a range query for performance reasons. + """ + MINMAX +} +""" +` + "`" + `GnoEvent` + "`" + ` is the event information exported by the Gno VM. +It has ` + "`" + `type` + "`" + `, ` + "`" + `pkg_path` + "`" + `, ` + "`" + `func` + "`" + `, and ` + "`" + `attrs` + "`" + `. +""" +type GnoEvent { + """ + ` + "`" + `type` + "`" + ` is the type of transaction event emitted. + """ + type: String! + """ + ` + "`" + `pkg_path` + "`" + ` is the path to the package that emitted the event. + """ + pkg_path: String! + """ + ` + "`" + `func` + "`" + ` is the name of the function that emitted the event. + """ + func: String! + """ + ` + "`" + `attrs` + "`" + ` is the event's attribute information. + """ + attrs: [GnoEventAttribute!] +} +""" +` + "`" + `GnoEventAttribute` + "`" + ` is the attributes that the event has. +It has ` + "`" + `key` + "`" + ` and ` + "`" + `value` + "`" + `. +""" +type GnoEventAttribute { + """ + The key of the event attribute. + """ + key: String! + """ + The value of the event attribute. + """ + value: String! +} +""" +` + "`" + `MemFile` + "`" + ` is the metadata information tied to a single gno package / realm file +""" +type MemFile { + """ + the name of the source file. + """ + name: String! + """ + the content of the source file. + """ + body: String! +} +""" +` + "`" + `MemFileInput` + "`" + ` is the metadata information tied to a single gno package / realm file. +""" +input MemFileInput { + """ + the name of the source file. + """ + name: String + """ + the content of the source file. + """ + body: String +} +""" +` + "`" + `MemPackage` + "`" + ` is the metadata information tied to package / realm deployment. +""" +type MemPackage { + """ + the name of the package. + """ + name: String! + """ + the gno path of the package. + """ + path: String! + """ + the associated package gno source. + """ + files: [MemFile!] +} +""" +` + "`" + `MemPackageInput` + "`" + ` represents a package stored in memory. +""" +input MemPackageInput { + """ + the name of the package. + """ + name: String + """ + the gno path of the package. + """ + path: String + """ + the associated package gno source. + """ + files: [MemFileInput] +} +""" +` + "`" + `MessageRoute` + "`" + ` is route type of the transactional message. +` + "`" + `MessageRoute` + "`" + ` has the values of vm and bank. +""" +enum MessageRoute { + vm + bank +} +""" +` + "`" + `MessageType` + "`" + ` is message type of the transaction. +` + "`" + `MessageType` + "`" + ` has the values ` + "`" + `send` + "`" + `, ` + "`" + `exec` + "`" + `, ` + "`" + `add_package` + "`" + `, and ` + "`" + `run` + "`" + `. +""" +enum MessageType { + """ + The route value for this message type is ` + "`" + `bank` + "`" + `, and the value for transactional messages is ` + "`" + `BankMsgSend` + "`" + `. + This is a transaction message used when sending native tokens. + """ + send + """ + The route value for this message type is ` + "`" + `vm` + "`" + `, and the value for transactional messages is ` + "`" + `MsgCall` + "`" + `. + This is a transaction message that executes a function in realm or package that is deployed in the GNO chain. + """ + exec + """ + The route value for this message type is ` + "`" + `vm` + "`" + `, and the value for transactional messages is ` + "`" + `MsgAddPackage` + "`" + `. + This is a transactional message that adds a package to the GNO chain. + """ + add_package + """ + The route value for this message type is ` + "`" + `vm` + "`" + `, and the value for transactional messages is ` + "`" + `MsgRun` + "`" + `. + This is a transactional message that executes an arbitrary Gno-coded TX message. + """ + run +} +union MessageValue = BankMsgSend | MsgCall | MsgAddPackage | MsgRun | UnexpectedMessage +""" +` + "`" + `MsgAddPackage` + "`" + ` is a message with a message router of ` + "`" + `vm` + "`" + ` and a message type of ` + "`" + `add_package` + "`" + `. +` + "`" + `MsgAddPackage` + "`" + ` is the package deployment tx message. +""" +type MsgAddPackage { + """ + the bech32 address of the package deployer. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + creator: String! + """ + the package being deployed. + """ + package: MemPackage! + """ + the amount of funds to be deposited at deployment, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + deposit: String! +} +""" +` + "`" + `MsgAddPackageInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `add_package` + "`" + `. +""" +input MsgAddPackageInput { + """ + the bech32 address of the package deployer. + You can filter by the package deployer's address. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + creator: String + """ + the package being deployed. + """ + package: MemPackageInput + """ + the amount of funds to be deposited at deployment, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + deposit: AmountInput +} +""" +` + "`" + `MsgCall` + "`" + ` is a message with a message router of ` + "`" + `vm` + "`" + ` and a message type of ` + "`" + `exec` + "`" + `. +` + "`" + `MsgCall` + "`" + ` is the method invocation tx message. +""" +type MsgCall { + """ + the bech32 address of the function caller. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + caller: String! + """ + the amount of funds to be deposited to the package, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + send: String! + """ + the gno package path. + """ + pkg_path: String! + """ + the function name being invoked. + """ + func: String! + """ + ` + "`" + `args` + "`" + ` are the arguments passed to the executed function. + """ + args: [String!] +} +""" +` + "`" + `MsgCallInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `exec` + "`" + `. +""" +input MsgCallInput { + """ + the bech32 address of the function caller. + You can filter by the function caller's address. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + caller: String + """ + the amount of funds to be deposited to the package, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + send: AmountInput + """ + the gno package path. + """ + pkg_path: String + """ + the function name being invoked. + """ + func: String + """ + ` + "`" + `args` + "`" + ` are the arguments passed to the executed function. + The arguments are checked in the order of the argument array and + if they are empty strings, they are excluded from the filtering criteria. + ex) ` + "`" + `["", "", "1"]` + "`" + ` <- Empty strings skip the condition. + """ + args: [String!] +} +""" +` + "`" + `MsgRun` + "`" + ` is a message with a message router of ` + "`" + `vm` + "`" + ` and a message type of ` + "`" + `run` + "`" + `. +` + "`" + `MsgRun is the execute arbitrary Gno code tx message` + "`" + `. +""" +type MsgRun { + """ + the bech32 address of the function caller. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + caller: String! + """ + the amount of funds to be deposited to the package, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + send: String! + """ + the package being executed. + """ + package: MemPackage! +} +""" +` + "`" + `MsgRunInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `run` + "`" + `. +""" +input MsgRunInput { + """ + the bech32 address of the function caller. + You can filter by the function caller's address. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + caller: String + """ + the amount of funds to be deposited to the package, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + send: AmountInput + """ + the package being executed. + """ + package: MemPackageInput +} +""" +filter for BlockTransaction objects +""" +input NestedFilterBlockTransaction { + """ + logical operator for BlockTransaction that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterBlockTransaction] + """ + logical operator for BlockTransaction that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterBlockTransaction] + """ + logical operator for BlockTransaction that will reverse conditions. + """ + _not: NestedFilterBlockTransaction + """ + filter for hash field. + """ + hash: FilterString + """ + filter for fee field. + """ + fee: NestedFilterTxFee + """ + filter for memo field. + """ + memo: FilterString +} +""" +filter for Coin objects +""" +input NestedFilterCoin { + """ + logical operator for Coin that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterCoin] + """ + logical operator for Coin that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterCoin] + """ + logical operator for Coin that will reverse conditions. + """ + _not: NestedFilterCoin + """ + filter for amount field. + """ + amount: FilterNumber + """ + filter for denom field. + """ + denom: FilterString +} +""" +filter for TransactionMessage objects +""" +input NestedFilterTransactionMessage { + """ + logical operator for TransactionMessage that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterTransactionMessage] + """ + logical operator for TransactionMessage that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterTransactionMessage] + """ + logical operator for TransactionMessage that will reverse conditions. + """ + _not: NestedFilterTransactionMessage + """ + filter for typeUrl field. + """ + typeUrl: FilterString + """ + filter for route field. + """ + route: FilterString +} +""" +filter for TransactionResponse objects +""" +input NestedFilterTransactionResponse { + """ + logical operator for TransactionResponse that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterTransactionResponse] + """ + logical operator for TransactionResponse that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterTransactionResponse] + """ + logical operator for TransactionResponse that will reverse conditions. + """ + _not: NestedFilterTransactionResponse + """ + filter for log field. + """ + log: FilterString + """ + filter for info field. + """ + info: FilterString + """ + filter for error field. + """ + error: FilterString + """ + filter for data field. + """ + data: FilterString +} +""" +filter for TxFee objects +""" +input NestedFilterTxFee { + """ + logical operator for TxFee that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterTxFee] + """ + logical operator for TxFee that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterTxFee] + """ + logical operator for TxFee that will reverse conditions. + """ + _not: NestedFilterTxFee + """ + filter for gas_wanted field. + """ + gas_wanted: FilterNumber + """ + filter for gas_fee field. + """ + gas_fee: NestedFilterCoin +} +""" +Root Query type to fetch data about Blocks and Transactions based on filters or retrieve the latest block height. +""" +type Query { + """ + 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. + """ + transactions(filter: TransactionFilter!): [Transaction!] + """ + Fetches Blocks matching the specified filter criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + """ + blocks(filter: BlockFilter!): [Block!] + """ + Returns the height of the most recently processed Block by the blockchain indexer, indicating the current length of the blockchain. + """ + latestBlockHeight: Int! + """ + Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + """ + getBlocks(where: FilterBlock!): [Block!] + """ + Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. + """ + getTransactions(where: FilterTransaction!): [Transaction!] +} +""" +Subscriptions provide a way for clients to receive real-time updates about Transactions and Blocks based on specified filter criteria. +Subscribers will only receive updates for events occurring after the subscription is established. +""" +type Subscription { + """ + Subscribes to real-time updates of Transactions that match the provided filter criteria. + This subscription starts immediately and only includes Transactions added to the blockchain after the subscription is active. + + This is useful for applications needing to track Transactions in real-time, such as wallets tracking incoming transactions + or analytics platforms monitoring blockchain activity. + + Returns: + - Transaction: Each received update is a Transaction object that matches the filter criteria. + """ + transactions(filter: TransactionFilter!): Transaction! + """ + Subscribes to real-time updates of Blocks that match the provided filter criteria. Similar to the Transactions subscription, + this subscription is active immediately upon creation and only includes Blocks added after the subscription begins. + + This subscription is ideal for services that need to be notified of new Blocks for processing or analysis, such as block explorers, + data aggregators, or security monitoring tools. + + Returns: + - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. + """ + blocks(filter: BlockFilter!): Block! +} +""" +Field representing a point on time. It is following the RFC3339Nano format ("2006-01-02T15:04:05.999999999Z07:00") +""" +scalar Time +""" +Defines a transaction within a block, detailing its execution specifics and content. +""" +type Transaction { + """ + A sequential index representing the order of this Transaction within its Block. Unique within the context of its Block. + """ + index: Int! @filterable(extras: [MINMAX]) + """ + Hash from Transaction content in base64 encoding. + """ + hash: String! @filterable + """ + The success can determine whether the transaction succeeded or failed. + """ + success: Boolean! @filterable + """ + The height of the Block in which this Transaction is included. Links the Transaction to its containing Block. + """ + block_height: Int! @filterable(extras: [MINMAX]) + """ + The declared amount of computational effort the sender is willing to pay for executing this Transaction. + """ + gas_wanted: Int! @filterable + """ + The actual amount of computational effort consumed to execute this Transaction. It could be less or equal to ` + "`" + `gas_wanted` + "`" + `. + """ + gas_used: Int! @filterable + """ + Fee includes the amount of coins paid in fees and the maximum + gas to be used by the transaction. + """ + gas_fee: Coin @filterable + """ + The payload of the Transaction in a raw format, typically containing the instructions and any data necessary for execution. + """ + content_raw: String! + """ + The payload of a message shows the contents of the messages in a transaction. + A message consists of ` + "`" + `router` + "`" + `, ` + "`" + `type` + "`" + `, and ` + "`" + `value` + "`" + ` (whose form depends on the ` + "`" + `router` + "`" + ` and ` + "`" + `type` + "`" + `). + """ + messages: [TransactionMessage]! @filterable + """ + ` + "`" + `memo` + "`" + ` are string information stored within a transaction. + ` + "`" + `memo` + "`" + ` can be utilized to find or distinguish transactions. + For example, when trading a specific exchange, you would utilize the memo field of the transaction. + """ + memo: String! @filterable + """ + ` + "`" + `response` + "`" + ` is the processing result of the transaction. + It has ` + "`" + `log` + "`" + `, ` + "`" + `info` + "`" + `, ` + "`" + `error` + "`" + `, and ` + "`" + `data` + "`" + `. + """ + response: TransactionResponse! @filterable +} +""" +` + "`" + `TransactionBankMessageInput` + "`" + ` represents input parameters required when the message router is ` + "`" + `bank` + "`" + `. +""" +input TransactionBankMessageInput { + """ + send represents input parameters required when the message type is ` + "`" + `send` + "`" + `. + """ + send: BankMsgSendInput +} +""" +Filters for querying Transactions within specified criteria related to their execution and placement within Blocks. +""" +input TransactionFilter { + """ + Minimum block height from which to start fetching Transactions, inclusive. Aids in scoping the search to recent Transactions. + """ + from_block_height: Int + """ + Maximum block height up to which Transactions should be fetched, exclusive. Helps in limiting the search to older Transactions. + """ + to_block_height: Int + """ + Minimum Transaction index from which to start fetching, inclusive. Facilitates ordering in Transaction queries. + """ + from_index: Int + """ + Maximum Transaction index up to which to fetch, exclusive. Ensures a limit on the ordering range for Transaction queries. + """ + to_index: Int + """ + Minimum ` + "`" + `gas_wanted` + "`" + ` value to filter Transactions by, inclusive. Filters Transactions based on the minimum computational effort declared. + """ + from_gas_wanted: Int + """ + Maximum ` + "`" + `gas_wanted` + "`" + ` value for filtering Transactions, exclusive. Limits Transactions based on the declared computational effort. + """ + to_gas_wanted: Int + """ + Minimum ` + "`" + `gas_used` + "`" + ` value to filter Transactions by, inclusive. Selects Transactions based on the minimum computational effort actually used. + """ + from_gas_used: Int + """ + Maximum ` + "`" + `gas_used` + "`" + ` value for filtering Transactions, exclusive. Refines selection based on the computational effort actually consumed. + """ + to_gas_used: Int + """ + Hash from Transaction content in base64 encoding. If this filter is used, any other filter will be ignored. + """ + hash: String + """ + Transaction's message to filter Transactions. + ` + "`" + `messages` + "`" + ` can be configured as a filter with a transaction message's ` + "`" + `router` + "`" + ` and ` + "`" + `type` + "`" + ` and ` + "`" + `parameters(bank / vm)` + "`" + `. + ` + "`" + `messages` + "`" + ` is entered as an array and works exclusively. + ex) ` + "`" + `messages[0] || messages[1] || messages[2]` + "`" + ` + """ + messages: [TransactionMessageInput!] + """ + ` + "`" + `memo` + "`" + ` are string information stored within a transaction. + ` + "`" + `memo` + "`" + ` can be utilized to find or distinguish transactions. + For example, when trading a specific exchange, you would utilize the memo field of the transaction. + """ + memo: String + """ + ` + "`" + `success` + "`" + ` is whether the transaction was successful or not. + ` + "`" + `success` + "`" + ` enables you to filter between successful and unsuccessful transactions. + """ + success: Boolean + """ + ` + "`" + `events` + "`" + ` are what the transaction has emitted. + ` + "`" + `events` + "`" + ` can be filtered with a specific event to query its transactions. + ` + "`" + `events` + "`" + ` is entered as an array and works exclusively. + ex) ` + "`" + `events[0] || events[1] || events[2]` + "`" + ` + """ + events: [EventInput!] +} +type TransactionMessage { + """ + The type of transaction message. + The value of ` + "`" + `typeUrl` + "`" + ` can be ` + "`" + `send` + "`" + `, ` + "`" + `exec` + "`" + `, ` + "`" + `add_package` + "`" + `, ` + "`" + `run` + "`" + `. + """ + typeUrl: String! @filterable + """ + The route of transaction message. + The value of ` + "`" + `route` + "`" + ` can be ` + "`" + `bank` + "`" + `, ` + "`" + `vm` + "`" + `. + """ + route: String! @filterable + """ + MessageValue is the content of the transaction. + ` + "`" + `value` + "`" + ` can be of type ` + "`" + `BankMsgSend` + "`" + `, ` + "`" + `MsgCall` + "`" + `, ` + "`" + `MsgAddPackage` + "`" + `, ` + "`" + `MsgRun` + "`" + `, ` + "`" + `UnexpectedMessage` + "`" + `. + """ + value: MessageValue! +} +""" +Transaction's message to filter Transactions. +` + "`" + `TransactionMessageInput` + "`" + ` can be configured as a filter with a transaction message's ` + "`" + `router` + "`" + ` and ` + "`" + `type` + "`" + ` and ` + "`" + `parameters(bank / vm)` + "`" + `. +""" +input TransactionMessageInput { + """ + The type of transaction message. + The value of ` + "`" + `typeUrl` + "`" + ` can be ` + "`" + `send` + "`" + `, ` + "`" + `exec` + "`" + `, ` + "`" + `add_package` + "`" + `, ` + "`" + `run` + "`" + `. + """ + type_url: MessageType + """ + The route of transaction message. + The value of ` + "`" + `route` + "`" + ` can be ` + "`" + `bank` + "`" + `, ` + "`" + `vm` + "`" + `. + """ + route: MessageRoute + """ + ` + "`" + `TransactionBankMessageInput` + "`" + ` represents input parameters required when the message router is ` + "`" + `bank` + "`" + `. + """ + bank_param: TransactionBankMessageInput + """ + ` + "`" + `TransactionVmMessageInput` + "`" + ` represents input parameters required when the message router is ` + "`" + `vm` + "`" + `. + """ + vm_param: TransactionVmMessageInput +} +""" +` + "`" + `TransactionResponse` + "`" + ` is the processing result of the transaction. +It has ` + "`" + `log` + "`" + `, ` + "`" + `info` + "`" + `, ` + "`" + `error` + "`" + `, and ` + "`" + `data` + "`" + `. +""" +type TransactionResponse { + """ + The log value associated with the Transaction execution, if any. + """ + log: String! @filterable + """ + The Info associated with the Transaction execution, if any. + """ + info: String! @filterable + """ + The error value associated with the Transaction execution, if any. + """ + error: String! @filterable + """ + The response data associated with the Transaction execution, if any. + """ + data: String! @filterable + """ + The emitted events associated with the transaction execution, if any. + """ + events: [Event] +} +""" +` + "`" + `TransactionVmMessageInput` + "`" + ` represents input parameters required when the message router is ` + "`" + `vm` + "`" + `. +""" +input TransactionVmMessageInput { + """ + ` + "`" + `MsgCallInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `exec` + "`" + `. + """ + exec: MsgCallInput + """ + ` + "`" + `MsgAddPackageInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `add_package` + "`" + `. + """ + add_package: MsgAddPackageInput + """ + ` + "`" + `MsgRunInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `run` + "`" + `. + """ + run: MsgRunInput +} +""" +The ` + "`" + `TxFee` + "`" + ` has information about the fee used in the transaction and the maximum gas fee specified by the user. +""" +type TxFee { + """ + gas limit + """ + gas_wanted: Int! @filterable + """ + The gas fee in the transaction. + """ + gas_fee: Coin! @filterable +} +""" +` + "`" + `UnexpectedMessage` + "`" + ` is an Undefined Message, which is a message that decoding failed. +""" +type UnexpectedMessage { + raw: String! +} +""" +` + "`" + `UnknownEvent` + "`" + ` is an unknown event type. +It has ` + "`" + `value` + "`" + `. +""" +type UnknownEvent { + """ + ` + "`" + `value` + "`" + ` is a raw event string. + """ + value: String! +} +`, BuiltIn: false}, } var parsedSchema = gqlparser.MustLoadSchema(sources...) @@ -910,6 +2259,21 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // region ***************************** args.gotpl ***************************** +func (ec *executionContext) dir_filterable_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 []model.FilterableAddons + if tmp, ok := rawArgs["extras"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("extras")) + arg0, err = ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["extras"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -940,6 +2304,36 @@ func (ec *executionContext) field_Query_blocks_args(ctx context.Context, rawArgs return args, nil } +func (ec *executionContext) field_Query_getBlocks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.FilterBlock + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg0, err = ec.unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_getTransactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.FilterTransaction + if tmp, ok := rawArgs["where"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + arg0, err = ec.unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, tmp) + if err != nil { + return nil, err + } + } + args["where"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_transactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -1054,7 +2448,7 @@ func (ec *executionContext) _BankMsgSend_from_address(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BankMsgSend_from_address(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BankMsgSend_from_address(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "BankMsgSend", Field: field, @@ -1098,7 +2492,7 @@ func (ec *executionContext) _BankMsgSend_to_address(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BankMsgSend_to_address(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BankMsgSend_to_address(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "BankMsgSend", Field: field, @@ -1142,7 +2536,7 @@ func (ec *executionContext) _BankMsgSend_amount(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BankMsgSend_amount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BankMsgSend_amount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "BankMsgSend", Field: field, @@ -1168,8 +2562,28 @@ func (ec *executionContext) _Block_hash(ctx context.Context, field graphql.Colle } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Hash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Hash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1186,7 +2600,7 @@ func (ec *executionContext) _Block_hash(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1212,8 +2626,32 @@ func (ec *executionContext) _Block_height(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Height(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Height(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + extras, err := ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, []interface{}{"MINMAX"}) + if err != nil { + return nil, err + } + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, extras) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int64); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int64`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1230,7 +2668,7 @@ func (ec *executionContext) _Block_height(ctx context.Context, field graphql.Col return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_height(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_height(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1256,8 +2694,28 @@ func (ec *executionContext) _Block_version(ctx context.Context, field graphql.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Version(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Version(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1274,7 +2732,7 @@ func (ec *executionContext) _Block_version(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1300,8 +2758,28 @@ func (ec *executionContext) _Block_chain_id(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ChainID(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ChainID(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1318,7 +2796,7 @@ func (ec *executionContext) _Block_chain_id(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_chain_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_chain_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1344,8 +2822,28 @@ func (ec *executionContext) _Block_time(ctx context.Context, field graphql.Colle } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Time(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Time(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(time.Time); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be time.Time`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1362,7 +2860,7 @@ func (ec *executionContext) _Block_time(ctx context.Context, field graphql.Colle return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_time(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1388,8 +2886,28 @@ func (ec *executionContext) _Block_num_txs(ctx context.Context, field graphql.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.NumTxs(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NumTxs(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int64); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int64`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1406,7 +2924,7 @@ func (ec *executionContext) _Block_num_txs(ctx context.Context, field graphql.Co return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_num_txs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_num_txs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1432,8 +2950,28 @@ func (ec *executionContext) _Block_total_txs(ctx context.Context, field graphql. } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TotalTxs(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalTxs(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int64); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int64`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1450,7 +2988,7 @@ func (ec *executionContext) _Block_total_txs(ctx context.Context, field graphql. return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_total_txs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_total_txs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1476,8 +3014,28 @@ func (ec *executionContext) _Block_app_version(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AppVersion(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AppVersion(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1494,7 +3052,7 @@ func (ec *executionContext) _Block_app_version(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_app_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_app_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1520,8 +3078,28 @@ func (ec *executionContext) _Block_last_block_hash(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LastBlockHash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastBlockHash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1538,7 +3116,7 @@ func (ec *executionContext) _Block_last_block_hash(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_last_block_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_last_block_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1564,8 +3142,28 @@ func (ec *executionContext) _Block_last_commit_hash(ctx context.Context, field g } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LastCommitHash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastCommitHash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1582,7 +3180,7 @@ func (ec *executionContext) _Block_last_commit_hash(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_last_commit_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_last_commit_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1608,8 +3206,28 @@ func (ec *executionContext) _Block_validators_hash(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ValidatorsHash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ValidatorsHash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1626,7 +3244,7 @@ func (ec *executionContext) _Block_validators_hash(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_validators_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_validators_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1652,8 +3270,28 @@ func (ec *executionContext) _Block_next_validators_hash(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.NextValidatorsHash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NextValidatorsHash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1670,7 +3308,7 @@ func (ec *executionContext) _Block_next_validators_hash(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_next_validators_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_next_validators_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1696,8 +3334,28 @@ func (ec *executionContext) _Block_consensus_hash(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ConsensusHash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ConsensusHash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1714,7 +3372,7 @@ func (ec *executionContext) _Block_consensus_hash(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_consensus_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_consensus_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1740,8 +3398,28 @@ func (ec *executionContext) _Block_app_hash(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AppHash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AppHash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1758,7 +3436,7 @@ func (ec *executionContext) _Block_app_hash(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_app_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_app_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1784,8 +3462,28 @@ func (ec *executionContext) _Block_last_results_hash(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LastResultsHash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastResultsHash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1802,7 +3500,7 @@ func (ec *executionContext) _Block_last_results_hash(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_last_results_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_last_results_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1828,8 +3526,28 @@ func (ec *executionContext) _Block_proposer_address_raw(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProposerAddressRaw(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProposerAddressRaw(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1846,7 +3564,7 @@ func (ec *executionContext) _Block_proposer_address_raw(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_proposer_address_raw(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_proposer_address_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1872,8 +3590,28 @@ func (ec *executionContext) _Block_txs(ctx context.Context, field graphql.Collec } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Txs(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Txs(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*model.BlockTransaction); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/gnolang/tx-indexer/serve/graph/model.BlockTransaction`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1890,7 +3628,7 @@ func (ec *executionContext) _Block_txs(ctx context.Context, field graphql.Collec return ec.marshalNBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Block_txs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Block_txs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Block", Field: field, @@ -1926,8 +3664,28 @@ func (ec *executionContext) _BlockTransaction_hash(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Hash, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Hash, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1944,7 +3702,7 @@ func (ec *executionContext) _BlockTransaction_hash(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BlockTransaction_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BlockTransaction_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "BlockTransaction", Field: field, @@ -1970,8 +3728,28 @@ func (ec *executionContext) _BlockTransaction_fee(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fee, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fee, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.TxFee); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.TxFee`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -1988,7 +3766,7 @@ func (ec *executionContext) _BlockTransaction_fee(ctx context.Context, field gra return ec.marshalNTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTxFee(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BlockTransaction_fee(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BlockTransaction_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "BlockTransaction", Field: field, @@ -2020,8 +3798,28 @@ func (ec *executionContext) _BlockTransaction_memo(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Memo, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Memo, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -2038,7 +3836,7 @@ func (ec *executionContext) _BlockTransaction_memo(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BlockTransaction_memo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BlockTransaction_memo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "BlockTransaction", Field: field, @@ -2082,7 +3880,7 @@ func (ec *executionContext) _BlockTransaction_content_raw(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BlockTransaction_content_raw(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BlockTransaction_content_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "BlockTransaction", Field: field, @@ -2108,8 +3906,28 @@ func (ec *executionContext) _Coin_amount(ctx context.Context, field graphql.Coll } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Amount, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Amount, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -2126,7 +3944,7 @@ func (ec *executionContext) _Coin_amount(ctx context.Context, field graphql.Coll return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Coin_amount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Coin_amount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Coin", Field: field, @@ -2152,8 +3970,28 @@ func (ec *executionContext) _Coin_denom(ctx context.Context, field graphql.Colle } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Denom, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Denom, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -2170,7 +4008,7 @@ func (ec *executionContext) _Coin_denom(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Coin_denom(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Coin_denom(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Coin", Field: field, @@ -2214,7 +4052,7 @@ func (ec *executionContext) _GnoEvent_type(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GnoEvent_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GnoEvent_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GnoEvent", Field: field, @@ -2258,7 +4096,7 @@ func (ec *executionContext) _GnoEvent_pkg_path(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GnoEvent_pkg_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GnoEvent_pkg_path(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GnoEvent", Field: field, @@ -2302,7 +4140,7 @@ func (ec *executionContext) _GnoEvent_func(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GnoEvent_func(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GnoEvent_func(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GnoEvent", Field: field, @@ -2343,7 +4181,7 @@ func (ec *executionContext) _GnoEvent_attrs(ctx context.Context, field graphql.C return ec.marshalOGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttributeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GnoEvent_attrs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GnoEvent_attrs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GnoEvent", Field: field, @@ -2393,7 +4231,7 @@ func (ec *executionContext) _GnoEventAttribute_key(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GnoEventAttribute_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GnoEventAttribute_key(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GnoEventAttribute", Field: field, @@ -2437,7 +4275,7 @@ func (ec *executionContext) _GnoEventAttribute_value(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GnoEventAttribute_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GnoEventAttribute_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GnoEventAttribute", Field: field, @@ -2481,7 +4319,7 @@ func (ec *executionContext) _MemFile_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MemFile_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MemFile_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MemFile", Field: field, @@ -2525,7 +4363,7 @@ func (ec *executionContext) _MemFile_body(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MemFile_body(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MemFile_body(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MemFile", Field: field, @@ -2569,7 +4407,7 @@ func (ec *executionContext) _MemPackage_name(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MemPackage_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MemPackage_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MemPackage", Field: field, @@ -2613,7 +4451,7 @@ func (ec *executionContext) _MemPackage_path(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MemPackage_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MemPackage_path(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MemPackage", Field: field, @@ -2654,7 +4492,7 @@ func (ec *executionContext) _MemPackage_files(ctx context.Context, field graphql return ec.marshalOMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MemPackage_files(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MemPackage_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MemPackage", Field: field, @@ -2704,7 +4542,7 @@ func (ec *executionContext) _MsgAddPackage_creator(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgAddPackage_creator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgAddPackage_creator(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgAddPackage", Field: field, @@ -2748,7 +4586,7 @@ func (ec *executionContext) _MsgAddPackage_package(ctx context.Context, field gr return ec.marshalNMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackage(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgAddPackage_package(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgAddPackage_package(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgAddPackage", Field: field, @@ -2800,7 +4638,7 @@ func (ec *executionContext) _MsgAddPackage_deposit(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgAddPackage_deposit(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgAddPackage_deposit(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgAddPackage", Field: field, @@ -2844,7 +4682,7 @@ func (ec *executionContext) _MsgCall_caller(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgCall_caller(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgCall_caller(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgCall", Field: field, @@ -2888,7 +4726,7 @@ func (ec *executionContext) _MsgCall_send(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgCall_send(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgCall_send(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgCall", Field: field, @@ -2932,7 +4770,7 @@ func (ec *executionContext) _MsgCall_pkg_path(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgCall_pkg_path(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgCall_pkg_path(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgCall", Field: field, @@ -2976,7 +4814,7 @@ func (ec *executionContext) _MsgCall_func(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgCall_func(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgCall_func(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgCall", Field: field, @@ -3017,7 +4855,7 @@ func (ec *executionContext) _MsgCall_args(ctx context.Context, field graphql.Col return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgCall_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgCall_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgCall", Field: field, @@ -3061,7 +4899,7 @@ func (ec *executionContext) _MsgRun_caller(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgRun_caller(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgRun_caller(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgRun", Field: field, @@ -3105,7 +4943,7 @@ func (ec *executionContext) _MsgRun_send(ctx context.Context, field graphql.Coll return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgRun_send(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgRun_send(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgRun", Field: field, @@ -3149,7 +4987,7 @@ func (ec *executionContext) _MsgRun_package(ctx context.Context, field graphql.C return ec.marshalNMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackage(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_MsgRun_package(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_MsgRun_package(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "MsgRun", Field: field, @@ -3365,7 +5203,7 @@ func (ec *executionContext) _Query_latestBlockHeight(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_latestBlockHeight(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_latestBlockHeight(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -3378,8 +5216,8 @@ func (ec *executionContext) fieldContext_Query_latestBlockHeight(ctx context.Con return fc, nil } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) +func (ec *executionContext) _Query_getBlocks(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getBlocks(ctx, field) if err != nil { return graphql.Null } @@ -3392,7 +5230,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return ec.resolvers.Query().GetBlocks(rctx, fc.Args["where"].(model.FilterBlock)) }) if err != nil { ec.Error(ctx, err) @@ -3401,9 +5239,173 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]*model.Block) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getBlocks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hash": + return ec.fieldContext_Block_hash(ctx, field) + case "height": + return ec.fieldContext_Block_height(ctx, field) + case "version": + return ec.fieldContext_Block_version(ctx, field) + case "chain_id": + return ec.fieldContext_Block_chain_id(ctx, field) + case "time": + return ec.fieldContext_Block_time(ctx, field) + case "num_txs": + return ec.fieldContext_Block_num_txs(ctx, field) + case "total_txs": + return ec.fieldContext_Block_total_txs(ctx, field) + case "app_version": + return ec.fieldContext_Block_app_version(ctx, field) + case "last_block_hash": + return ec.fieldContext_Block_last_block_hash(ctx, field) + case "last_commit_hash": + return ec.fieldContext_Block_last_commit_hash(ctx, field) + case "validators_hash": + return ec.fieldContext_Block_validators_hash(ctx, field) + case "next_validators_hash": + return ec.fieldContext_Block_next_validators_hash(ctx, field) + case "consensus_hash": + return ec.fieldContext_Block_consensus_hash(ctx, field) + case "app_hash": + return ec.fieldContext_Block_app_hash(ctx, field) + case "last_results_hash": + return ec.fieldContext_Block_last_results_hash(ctx, field) + case "proposer_address_raw": + return ec.fieldContext_Block_proposer_address_raw(ctx, field) + case "txs": + return ec.fieldContext_Block_txs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Block", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_getBlocks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_getTransactions(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getTransactions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetTransactions(rctx, fc.Args["where"].(model.FilterTransaction)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.Transaction) + fc.Result = res + return ec.marshalOTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getTransactions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "index": + return ec.fieldContext_Transaction_index(ctx, field) + case "hash": + return ec.fieldContext_Transaction_hash(ctx, field) + case "success": + return ec.fieldContext_Transaction_success(ctx, field) + case "block_height": + return ec.fieldContext_Transaction_block_height(ctx, field) + case "gas_wanted": + return ec.fieldContext_Transaction_gas_wanted(ctx, field) + case "gas_used": + return ec.fieldContext_Transaction_gas_used(ctx, field) + case "gas_fee": + return ec.fieldContext_Transaction_gas_fee(ctx, field) + case "content_raw": + return ec.fieldContext_Transaction_content_raw(ctx, field) + case "messages": + return ec.fieldContext_Transaction_messages(ctx, field) + case "memo": + return ec.fieldContext_Transaction_memo(ctx, field) + case "response": + return ec.fieldContext_Transaction_response(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Transaction", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_getTransactions_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -3480,7 +5482,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -3718,8 +5720,32 @@ func (ec *executionContext) _Transaction_index(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Index(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Index(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + extras, err := ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, []interface{}{"MINMAX"}) + if err != nil { + return nil, err + } + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, extras) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3736,7 +5762,7 @@ func (ec *executionContext) _Transaction_index(ctx context.Context, field graphq return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_index(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_index(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -3762,8 +5788,28 @@ func (ec *executionContext) _Transaction_hash(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Hash(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Hash(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3780,7 +5826,7 @@ func (ec *executionContext) _Transaction_hash(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -3806,8 +5852,28 @@ func (ec *executionContext) _Transaction_success(ctx context.Context, field grap } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Success(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Success(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3824,7 +5890,7 @@ func (ec *executionContext) _Transaction_success(ctx context.Context, field grap return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_success(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_success(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -3850,8 +5916,32 @@ func (ec *executionContext) _Transaction_block_height(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BlockHeight(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BlockHeight(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + extras, err := ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, []interface{}{"MINMAX"}) + if err != nil { + return nil, err + } + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, extras) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3868,7 +5958,7 @@ func (ec *executionContext) _Transaction_block_height(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_block_height(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_block_height(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -3894,8 +5984,28 @@ func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field g } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GasWanted(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GasWanted(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3912,7 +6022,7 @@ func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field g return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_gas_wanted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_gas_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -3938,8 +6048,28 @@ func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GasUsed(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GasUsed(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3956,7 +6086,7 @@ func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field gra return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_gas_used(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_gas_used(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -3982,8 +6112,28 @@ func (ec *executionContext) _Transaction_gas_fee(ctx context.Context, field grap } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GasFee(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GasFee(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Coin); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.Coin`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3997,7 +6147,7 @@ func (ec *executionContext) _Transaction_gas_fee(ctx context.Context, field grap return ec.marshalOCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_gas_fee(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_gas_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -4047,7 +6197,7 @@ func (ec *executionContext) _Transaction_content_raw(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_content_raw(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_content_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -4073,8 +6223,28 @@ func (ec *executionContext) _Transaction_messages(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Messages(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Messages(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*model.TransactionMessage); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/gnolang/tx-indexer/serve/graph/model.TransactionMessage`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4091,7 +6261,7 @@ func (ec *executionContext) _Transaction_messages(ctx context.Context, field gra return ec.marshalNTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessage(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_messages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_messages(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -4125,8 +6295,28 @@ func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Memo(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Memo(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4143,7 +6333,7 @@ func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_memo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_memo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -4169,8 +6359,28 @@ func (ec *executionContext) _Transaction_response(ctx context.Context, field gra } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Response(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Response(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.TransactionResponse); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.TransactionResponse`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4187,7 +6397,7 @@ func (ec *executionContext) _Transaction_response(ctx context.Context, field gra return ec.marshalNTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionResponse(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_response(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_response(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -4225,12 +6435,32 @@ func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TypeURL, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TypeURL, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } if resTmp == nil { if !graphql.HasFieldError(ctx, fc) { @@ -4243,7 +6473,7 @@ func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionMessage_typeUrl(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionMessage_typeUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionMessage", Field: field, @@ -4269,8 +6499,28 @@ func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Route, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Route, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4287,7 +6537,7 @@ func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionMessage_route(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionMessage_route(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionMessage", Field: field, @@ -4331,7 +6581,7 @@ func (ec *executionContext) _TransactionMessage_value(ctx context.Context, field return ec.marshalNMessageValue2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageValue(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionMessage_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionMessage_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionMessage", Field: field, @@ -4357,8 +6607,28 @@ func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Log(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Log(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4375,7 +6645,7 @@ func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_log(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_log(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionResponse", Field: field, @@ -4401,8 +6671,28 @@ func (ec *executionContext) _TransactionResponse_info(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Info(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Info(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4419,7 +6709,7 @@ func (ec *executionContext) _TransactionResponse_info(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_info(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_info(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionResponse", Field: field, @@ -4445,8 +6735,28 @@ func (ec *executionContext) _TransactionResponse_error(ctx context.Context, fiel } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Error(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Error(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4463,7 +6773,7 @@ func (ec *executionContext) _TransactionResponse_error(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_error(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionResponse", Field: field, @@ -4489,8 +6799,28 @@ func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Data(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Data(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4507,7 +6837,7 @@ func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionResponse", Field: field, @@ -4548,7 +6878,7 @@ func (ec *executionContext) _TransactionResponse_events(ctx context.Context, fie return ec.marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_events(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionResponse", Field: field, @@ -4574,8 +6904,28 @@ func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GasWanted, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GasWanted, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4592,7 +6942,7 @@ func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TxFee_gas_wanted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TxFee_gas_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TxFee", Field: field, @@ -4618,8 +6968,28 @@ func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GasFee, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GasFee, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Coin); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.Coin`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4636,7 +7006,7 @@ func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.Co return ec.marshalNCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TxFee_gas_fee(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TxFee_gas_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TxFee", Field: field, @@ -4686,7 +7056,7 @@ func (ec *executionContext) _UnexpectedMessage_raw(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UnexpectedMessage_raw(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UnexpectedMessage_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "UnexpectedMessage", Field: field, @@ -4730,7 +7100,7 @@ func (ec *executionContext) _UnknownEvent_value(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UnknownEvent_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UnknownEvent_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "UnknownEvent", Field: field, @@ -4774,7 +7144,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -4815,7 +7185,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -4859,7 +7229,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -4903,7 +7273,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -4957,7 +7327,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -5001,7 +7371,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -5042,7 +7412,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -5086,7 +7456,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -5127,7 +7497,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -5171,7 +7541,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -5212,7 +7582,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -5256,7 +7626,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -5310,7 +7680,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -5376,7 +7746,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -5417,7 +7787,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -5461,7 +7831,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -5502,7 +7872,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -5546,7 +7916,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -5609,7 +7979,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -5650,7 +8020,7 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -5694,7 +8064,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -5760,7 +8130,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -5823,7 +8193,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -5886,7 +8256,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -5952,7 +8322,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -6008,7 +8378,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6049,7 +8419,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6090,7 +8460,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6197,7 +8567,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6260,7 +8630,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6385,7 +8755,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6436,7 +8806,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6499,7 +8869,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -6728,213 +9098,1275 @@ func (ec *executionContext) unmarshalInputEventInput(ctx context.Context, obj in return it, nil } -func (ec *executionContext) unmarshalInputMemFileInput(ctx context.Context, obj interface{}) (model.MemFileInput, error) { - var it model.MemFileInput +func (ec *executionContext) unmarshalInputFilterBlock(ctx context.Context, obj interface{}) (model.FilterBlock, error) { + var it model.FilterBlock asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"name", "body"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "hash", "height", "version", "chain_id", "time", "num_txs", "total_txs", "app_version", "last_block_hash", "last_commit_hash", "validators_hash", "next_validators_hash", "consensus_hash", "app_hash", "last_results_hash", "proposer_address_raw", "txs"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, v) if err != nil { return it, err } - it.Name = data - case "body": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, v) if err != nil { return it, err } - it.Body = data + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Hash = data + case "height": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("height")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.Height = data + case "version": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("version")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Version = data + case "chain_id": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chain_id")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.ChainID = data + case "time": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("time")) + data, err := ec.unmarshalOFilterTime2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTime(ctx, v) + if err != nil { + return it, err + } + it.Time = data + case "num_txs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("num_txs")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.NumTxs = data + case "total_txs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("total_txs")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.TotalTxs = data + case "app_version": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app_version")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.AppVersion = data + case "last_block_hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last_block_hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.LastBlockHash = data + case "last_commit_hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last_commit_hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.LastCommitHash = data + case "validators_hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("validators_hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.ValidatorsHash = data + case "next_validators_hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("next_validators_hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.NextValidatorsHash = data + case "consensus_hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("consensus_hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.ConsensusHash = data + case "app_hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app_hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.AppHash = data + case "last_results_hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last_results_hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.LastResultsHash = data + case "proposer_address_raw": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("proposer_address_raw")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.ProposerAddressRaw = data + case "txs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("txs")) + data, err := ec.unmarshalONestedFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) + if err != nil { + return it, err + } + it.Txs = data } } return it, nil } -func (ec *executionContext) unmarshalInputMemPackageInput(ctx context.Context, obj interface{}) (model.MemPackageInput, error) { - var it model.MemPackageInput +func (ec *executionContext) unmarshalInputFilterBlockTransaction(ctx context.Context, obj interface{}) (model.FilterBlockTransaction, error) { + var it model.FilterBlockTransaction asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"name", "path", "files"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "hash", "fee", "memo"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(ctx, v) if err != nil { return it, err } - it.Name = data - case "path": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(ctx, v) if err != nil { return it, err } - it.Path = data - case "files": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("files")) - data, err := ec.unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx, v) + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(ctx, v) if err != nil { return it, err } - it.Files = data + it.Not = data + case "hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Hash = data + case "fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fee")) + data, err := ec.unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Fee = data + case "memo": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Memo = data } } return it, nil } -func (ec *executionContext) unmarshalInputMsgAddPackageInput(ctx context.Context, obj interface{}) (model.MsgAddPackageInput, error) { - var it model.MsgAddPackageInput +func (ec *executionContext) unmarshalInputFilterBoolean(ctx context.Context, obj interface{}) (model.FilterBoolean, error) { + var it model.FilterBoolean asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"creator", "package", "deposit"} + fieldsInOrder := [...]string{"exists", "eq"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "creator": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("creator")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.Creator = data - case "package": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) - data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) + case "exists": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Package = data - case "deposit": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deposit")) - data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + it.Exists = data + case "eq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Deposit = data + it.Eq = data } } return it, nil } -func (ec *executionContext) unmarshalInputMsgCallInput(ctx context.Context, obj interface{}) (model.MsgCallInput, error) { - var it model.MsgCallInput +func (ec *executionContext) unmarshalInputFilterCoin(ctx context.Context, obj interface{}) (model.FilterCoin, error) { + var it model.FilterCoin asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"caller", "send", "pkg_path", "func", "args"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "amount", "denom"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "caller": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterCoin(ctx, v) if err != nil { return it, err } - it.Caller = data - case "send": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) - data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterCoin(ctx, v) if err != nil { return it, err } - it.Send = data - case "pkg_path": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterCoin(ctx, v) if err != nil { return it, err } - it.PkgPath = data - case "func": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Not = data + case "amount": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amount")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) if err != nil { return it, err } - it.Func = data - case "args": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.Amount = data + case "denom": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("denom")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Args = data + it.Denom = data } } return it, nil } -func (ec *executionContext) unmarshalInputMsgRunInput(ctx context.Context, obj interface{}) (model.MsgRunInput, error) { - var it model.MsgRunInput +func (ec *executionContext) unmarshalInputFilterNumber(ctx context.Context, obj interface{}) (model.FilterNumber, error) { + var it model.FilterNumber asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"caller", "send", "package"} + fieldsInOrder := [...]string{"exists", "eq", "neq", "gt", "lt"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "caller": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + case "exists": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) if err != nil { return it, err } - it.Caller = data - case "send": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) - data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + it.Exists = data + case "eq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.Send = data - case "package": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) - data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) + it.Eq = data + case "neq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } - it.Package = data - } + it.Neq = data + case "gt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gt")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Gt = data + case "lt": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lt")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Lt = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterString(ctx context.Context, obj interface{}) (model.FilterString, error) { + var it model.FilterString + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"exists", "eq", "neq", "like", "nlike"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "exists": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Exists = data + case "eq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Eq = data + case "neq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Neq = data + case "like": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("like")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Like = data + case "nlike": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nlike")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Nlike = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTime(ctx context.Context, obj interface{}) (model.FilterTime, error) { + var it model.FilterTime + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"exists", "eq", "neq", "before", "after"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "exists": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Exists = data + case "eq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Eq = data + case "neq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Neq = data + case "before": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Before = data + case "after": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.After = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTransaction(ctx context.Context, obj interface{}) (model.FilterTransaction, error) { + var it model.FilterTransaction + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "index", "hash", "success", "block_height", "gas_wanted", "gas_used", "gas_fee", "messages", "memo", "response"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "index": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("index")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.Index = data + case "hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Hash = data + case "success": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("success")) + data, err := ec.unmarshalOFilterBoolean2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBoolean(ctx, v) + if err != nil { + return it, err + } + it.Success = data + case "block_height": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("block_height")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.BlockHeight = data + case "gas_wanted": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.GasWanted = data + case "gas_used": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_used")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.GasUsed = data + case "gas_fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_fee")) + data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.GasFee = data + case "messages": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("messages")) + data, err := ec.unmarshalONestedFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Messages = data + case "memo": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Memo = data + case "response": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("response")) + data, err := ec.unmarshalONestedFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Response = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTransactionMessage(ctx context.Context, obj interface{}) (model.FilterTransactionMessage, error) { + var it model.FilterTransactionMessage + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "typeUrl", "route"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "typeUrl": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeUrl")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.TypeURL = data + case "route": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("route")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Route = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTransactionResponse(ctx context.Context, obj interface{}) (model.FilterTransactionResponse, error) { + var it model.FilterTransactionResponse + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "log", "info", "error", "data"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "log": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("log")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Log = data + case "info": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("info")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Info = data + case "error": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("error")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Error = data + case "data": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Data = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTxFee(ctx context.Context, obj interface{}) (model.FilterTxFee, error) { + var it model.FilterTxFee + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "gas_wanted", "gas_fee"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "gas_wanted": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.GasWanted = data + case "gas_fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_fee")) + data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.GasFee = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMemFileInput(ctx context.Context, obj interface{}) (model.MemFileInput, error) { + var it model.MemFileInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "body"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "body": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Body = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMemPackageInput(ctx context.Context, obj interface{}) (model.MemPackageInput, error) { + var it model.MemPackageInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "path", "files"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Path = data + case "files": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("files")) + data, err := ec.unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx, v) + if err != nil { + return it, err + } + it.Files = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMsgAddPackageInput(ctx context.Context, obj interface{}) (model.MsgAddPackageInput, error) { + var it model.MsgAddPackageInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"creator", "package", "deposit"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "creator": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("creator")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Creator = data + case "package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) + data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) + if err != nil { + return it, err + } + it.Package = data + case "deposit": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deposit")) + data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + if err != nil { + return it, err + } + it.Deposit = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMsgCallInput(ctx context.Context, obj interface{}) (model.MsgCallInput, error) { + var it model.MsgCallInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"caller", "send", "pkg_path", "func", "args"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + if err != nil { + return it, err + } + it.Send = data + case "pkg_path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PkgPath = data + case "func": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Func = data + case "args": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Args = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMsgRunInput(ctx context.Context, obj interface{}) (model.MsgRunInput, error) { + var it model.MsgRunInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"caller", "send", "package"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + if err != nil { + return it, err + } + it.Send = data + case "package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) + data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) + if err != nil { + return it, err + } + it.Package = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNestedFilterBlockTransaction(ctx context.Context, obj interface{}) (model.NestedFilterBlockTransaction, error) { + var it model.NestedFilterBlockTransaction + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "hash", "fee", "memo"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Hash = data + case "fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fee")) + data, err := ec.unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Fee = data + case "memo": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Memo = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNestedFilterCoin(ctx context.Context, obj interface{}) (model.NestedFilterCoin, error) { + var it model.NestedFilterCoin + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "amount", "denom"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "amount": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amount")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.Amount = data + case "denom": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("denom")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Denom = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNestedFilterTransactionMessage(ctx context.Context, obj interface{}) (model.NestedFilterTransactionMessage, error) { + var it model.NestedFilterTransactionMessage + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "typeUrl", "route"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "typeUrl": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeUrl")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.TypeURL = data + case "route": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("route")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Route = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNestedFilterTransactionResponse(ctx context.Context, obj interface{}) (model.NestedFilterTransactionResponse, error) { + var it model.NestedFilterTransactionResponse + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "log", "info", "error", "data"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "log": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("log")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Log = data + case "info": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("info")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Info = data + case "error": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("error")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Error = data + case "data": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Data = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNestedFilterTxFee(ctx context.Context, obj interface{}) (model.NestedFilterTxFee, error) { + var it model.NestedFilterTxFee + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "gas_wanted", "gas_fee"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "gas_wanted": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) + data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + if err != nil { + return it, err + } + it.GasWanted = data + case "gas_fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_fee")) + data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.GasFee = data + } } return it, nil @@ -7869,7 +11301,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "transactions": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7888,7 +11320,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "blocks": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7925,6 +11357,44 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "getBlocks": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_getBlocks(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "getTransactions": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_getTransactions(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "__type": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { @@ -8700,14 +12170,34 @@ func (ec *executionContext) marshalNCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexe return ec._Coin(ctx, sel, v) } -func (ec *executionContext) unmarshalNEventAttributeInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventAttributeInput(ctx context.Context, v interface{}) (*model.EventAttributeInput, error) { - res, err := ec.unmarshalInputEventAttributeInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalNEventAttributeInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventAttributeInput(ctx context.Context, v interface{}) (*model.EventAttributeInput, error) { + res, err := ec.unmarshalInputEventAttributeInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNEventInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInput(ctx context.Context, v interface{}) (*model.EventInput, error) { + res, err := ec.unmarshalInputEventInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx context.Context, v interface{}) (model.FilterBlock, error) { + res, err := ec.unmarshalInputFilterBlock(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx context.Context, v interface{}) (model.FilterTransaction, error) { + res, err := ec.unmarshalInputFilterTransaction(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNEventInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInput(ctx context.Context, v interface{}) (*model.EventInput, error) { - res, err := ec.unmarshalInputEventInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx context.Context, v interface{}) (model.FilterableAddons, error) { + var res model.FilterableAddons + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx context.Context, sel ast.SelectionSet, v model.FilterableAddons) graphql.Marshaler { + return v } func (ec *executionContext) marshalNGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttribute(ctx context.Context, sel ast.SelectionSet, v *model.GnoEventAttribute) graphql.Marshaler { @@ -9195,67 +12685,396 @@ func (ec *executionContext) marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑin } else { go f(i) } - + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx context.Context, sel ast.SelectionSet, v *model.BlockTransaction) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._BlockTransaction(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) marshalOCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx context.Context, sel ast.SelectionSet, v *model.Coin) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Coin(ctx, sel, v) +} + +func (ec *executionContext) marshalOEvent2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx context.Context, sel ast.SelectionSet, v model.Event) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Event(ctx, sel, v) +} + +func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx context.Context, sel ast.SelectionSet, v []model.Event) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOEvent2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) unmarshalOEventAttributeInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventAttributeInputᚄ(ctx context.Context, v interface{}) ([]*model.EventAttributeInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.EventAttributeInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEventAttributeInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventAttributeInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInputᚄ(ctx context.Context, v interface{}) ([]*model.EventInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.EventInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNEventInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx context.Context, v interface{}) ([]*model.FilterBlock, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterBlock, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx context.Context, v interface{}) (*model.FilterBlock, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterBlock(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(ctx context.Context, v interface{}) ([]*model.FilterBlockTransaction, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterBlockTransaction, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(ctx context.Context, v interface{}) (*model.FilterBlockTransaction, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterBlockTransaction(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterBoolean2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBoolean(ctx context.Context, v interface{}) (*model.FilterBoolean, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterBoolean(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterCoin(ctx context.Context, v interface{}) ([]*model.FilterCoin, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterCoin, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterCoin(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterCoin(ctx context.Context, v interface{}) (*model.FilterCoin, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterCoin(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx context.Context, v interface{}) (*model.FilterNumber, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterNumber(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx context.Context, v interface{}) (*model.FilterString, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterString(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterTime2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTime(ctx context.Context, v interface{}) (*model.FilterTime, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterTime(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx context.Context, v interface{}) ([]*model.FilterTransaction, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterTransaction, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, vSlice[i]) + if err != nil { + return nil, err + } } - wg.Wait() + return res, nil +} - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } +func (ec *executionContext) unmarshalOFilterTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx context.Context, v interface{}) (*model.FilterTransaction, error) { + if v == nil { + return nil, nil } - - return ret + res, err := ec.unmarshalInputFilterTransaction(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx context.Context, sel ast.SelectionSet, v *model.BlockTransaction) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx context.Context, v interface{}) ([]*model.FilterTransactionMessage, error) { if v == nil { - return graphql.Null + return nil, nil } - return ec._BlockTransaction(ctx, sel, v) + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterTransactionMessage, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalOFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx context.Context, v interface{}) (*model.FilterTransactionMessage, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterTransactionMessage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - return res +func (ec *executionContext) unmarshalOFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx context.Context, v interface{}) ([]*model.FilterTransactionResponse, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterTransactionResponse, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { +func (ec *executionContext) unmarshalOFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx context.Context, v interface{}) (*model.FilterTransactionResponse, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalBoolean(v) + res, err := ec.unmarshalInputFilterTransactionResponse(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx context.Context, v interface{}) ([]*model.FilterTxFee, error) { if v == nil { - return graphql.Null + return nil, nil } - res := graphql.MarshalBoolean(*v) - return res + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterTxFee, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) marshalOCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx context.Context, sel ast.SelectionSet, v *model.Coin) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx context.Context, v interface{}) (*model.FilterTxFee, error) { if v == nil { - return graphql.Null + return nil, nil } - return ec._Coin(ctx, sel, v) + res, err := ec.unmarshalInputFilterTxFee(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOEvent2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx context.Context, sel ast.SelectionSet, v model.Event) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx context.Context, v interface{}) ([]model.FilterableAddons, error) { if v == nil { - return graphql.Null + return nil, nil } - return ec._Event(ctx, sel, v) + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]model.FilterableAddons, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx context.Context, sel ast.SelectionSet, v []model.Event) graphql.Marshaler { +func (ec *executionContext) marshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx context.Context, sel ast.SelectionSet, v []model.FilterableAddons) graphql.Marshaler { if v == nil { return graphql.Null } @@ -9282,7 +13101,7 @@ func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindex if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOEvent2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx, sel, v[i]) + ret[i] = ec.marshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx, sel, v[i]) } if isLen1 { f(i) @@ -9293,47 +13112,13 @@ func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindex } wg.Wait() - return ret -} - -func (ec *executionContext) unmarshalOEventAttributeInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventAttributeInputᚄ(ctx context.Context, v interface{}) ([]*model.EventAttributeInput, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*model.EventAttributeInput, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNEventAttributeInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventAttributeInput(ctx, vSlice[i]) - if err != nil { - return nil, err + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } } - return res, nil -} -func (ec *executionContext) unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInputᚄ(ctx context.Context, v interface{}) ([]*model.EventInput, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*model.EventInput, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNEventInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInput(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil + return ret } func (ec *executionContext) marshalOGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttributeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GnoEventAttribute) graphql.Marshaler { @@ -9538,6 +13323,146 @@ func (ec *executionContext) unmarshalOMsgRunInput2ᚖgithubᚗcomᚋgnolangᚋtx return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx context.Context, v interface{}) ([]*model.NestedFilterBlockTransaction, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterBlockTransaction, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx context.Context, v interface{}) (*model.NestedFilterBlockTransaction, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterBlockTransaction(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx context.Context, v interface{}) ([]*model.NestedFilterCoin, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterCoin, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx context.Context, v interface{}) (*model.NestedFilterCoin, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterCoin(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx context.Context, v interface{}) ([]*model.NestedFilterTransactionMessage, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterTransactionMessage, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx context.Context, v interface{}) (*model.NestedFilterTransactionMessage, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterTransactionMessage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx context.Context, v interface{}) ([]*model.NestedFilterTransactionResponse, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterTransactionResponse, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx context.Context, v interface{}) (*model.NestedFilterTransactionResponse, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterTransactionResponse(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx context.Context, v interface{}) ([]*model.NestedFilterTxFee, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterTxFee, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx context.Context, v interface{}) (*model.NestedFilterTxFee, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterTxFee(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { if v == nil { return nil, nil diff --git a/serve/graph/model/filter_methods.go b/serve/graph/model/filter_methods.go new file mode 100644 index 00000000..4c5c9372 --- /dev/null +++ b/serve/graph/model/filter_methods.go @@ -0,0 +1,1070 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +import ( + "regexp" + "time" +) + +///////////////////////////////// CUSTOM TYPES ///////////////////////////////// + +func (f *NestedFilterTxFee) Eval(obj *TxFee) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle GasWanted field + toEvalGasWanted := toIntPtr(obj.GasWanted) + if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { + return false + } + + // Handle GasFee field + toEvalGasFee := obj.GasFee + if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { + return false + } + + return true +} + +func (f *NestedFilterTransactionResponse) Eval(obj *TransactionResponse) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Log field + toEvalLog := obj.Log() + if f.Log != nil && !f.Log.Eval(&toEvalLog) { + return false + } + + // Handle Info field + toEvalInfo := obj.Info() + if f.Info != nil && !f.Info.Eval(&toEvalInfo) { + return false + } + + // Handle Error field + toEvalError := obj.Error() + if f.Error != nil && !f.Error.Eval(&toEvalError) { + return false + } + + // Handle Data field + toEvalData := obj.Data() + if f.Data != nil && !f.Data.Eval(&toEvalData) { + return false + } + + return true +} + +func (f *NestedFilterTransactionMessage) Eval(obj *TransactionMessage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle TypeURL field + toEvalTypeURL := obj.TypeURL + if f.TypeURL != nil && !f.TypeURL.Eval(&toEvalTypeURL) { + return false + } + + // Handle Route field + toEvalRoute := obj.Route + if f.Route != nil && !f.Route.Eval(&toEvalRoute) { + return false + } + + return true +} + +func (f *NestedFilterCoin) Eval(obj *Coin) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Denom field + toEvalDenom := obj.Denom + if f.Denom != nil && !f.Denom.Eval(&toEvalDenom) { + return false + } + + // Handle Amount field + toEvalAmount := toIntPtr(obj.Amount) + if f.Amount != nil && !f.Amount.Eval(toEvalAmount) { + return false + } + + return true +} + +func (f *NestedFilterBlockTransaction) Eval(obj *BlockTransaction) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Memo field + toEvalMemo := obj.Memo + if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle Fee field + toEvalFee := obj.Fee + if f.Fee != nil && !f.Fee.Eval(toEvalFee) { + return false + } + + return true +} + +func (f *FilterTxFee) Eval(obj *TxFee) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle GasWanted field + toEvalGasWanted := toIntPtr(obj.GasWanted) + if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { + return false + } + + // Handle GasFee field + toEvalGasFee := obj.GasFee + if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { + return false + } + + return true +} + +func (f *FilterTransactionResponse) Eval(obj *TransactionResponse) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Log field + toEvalLog := obj.Log() + if f.Log != nil && !f.Log.Eval(&toEvalLog) { + return false + } + + // Handle Info field + toEvalInfo := obj.Info() + if f.Info != nil && !f.Info.Eval(&toEvalInfo) { + return false + } + + // Handle Error field + toEvalError := obj.Error() + if f.Error != nil && !f.Error.Eval(&toEvalError) { + return false + } + + // Handle Data field + toEvalData := obj.Data() + if f.Data != nil && !f.Data.Eval(&toEvalData) { + return false + } + + return true +} + +func (f *FilterTransactionMessage) Eval(obj *TransactionMessage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle TypeURL field + toEvalTypeURL := obj.TypeURL + if f.TypeURL != nil && !f.TypeURL.Eval(&toEvalTypeURL) { + return false + } + + // Handle Route field + toEvalRoute := obj.Route + if f.Route != nil && !f.Route.Eval(&toEvalRoute) { + return false + } + + return true +} + +func (f *FilterTransaction) Eval(obj *Transaction) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Success field + toEvalSuccess := obj.Success() + if f.Success != nil && !f.Success.Eval(&toEvalSuccess) { + return false + } + + // Handle Response field + toEvalResponse := obj.Response() + if f.Response != nil && !f.Response.Eval(toEvalResponse) { + return false + } + + // Handle Messages slice + if f.Messages != nil { + for _, elem := range obj.Messages() { + if !f.Messages.Eval(elem) { + return false + } + } + } + + // Handle Memo field + toEvalMemo := obj.Memo() + if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { + return false + } + + // Handle Index field + toEvalIndex := toIntPtr(obj.Index()) + if f.Index != nil && !f.Index.Eval(toEvalIndex) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash() + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle GasWanted field + toEvalGasWanted := toIntPtr(obj.GasWanted()) + if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { + return false + } + + // Handle GasUsed field + toEvalGasUsed := toIntPtr(obj.GasUsed()) + if f.GasUsed != nil && !f.GasUsed.Eval(toEvalGasUsed) { + return false + } + + // Handle GasFee field + toEvalGasFee := obj.GasFee() + if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { + return false + } + + // Handle BlockHeight field + toEvalBlockHeight := toIntPtr(obj.BlockHeight()) + if f.BlockHeight != nil && !f.BlockHeight.Eval(toEvalBlockHeight) { + return false + } + + return true +} + +// MinMax function for Index +func (f *FilterTransaction) MinMaxIndex() (min *int, max *int) { + // Recursively handle And conditions + if len(f.And) > 0 { + for _, subFilter := range f.And { + subMin, subMax := subFilter.MinMaxIndex() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + // Recursively handle Or conditions + if len(f.Or) > 0 { + for _, subFilter := range f.Or { + subMin, subMax := subFilter.MinMaxIndex() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + if f.Index != nil { + if f.Index.Gt != nil { + if min == nil || *f.Index.Gt < *min { + min = f.Index.Gt + } + if max == nil || *f.Index.Gt > *max { + max = f.Index.Gt + } + } + + if f.Index.Lt != nil { + if min == nil || *f.Index.Lt < *min { + min = f.Index.Lt + } + if max == nil || *f.Index.Lt > *max { + max = f.Index.Lt + } + } + + if f.Index.Eq != nil { + if min == nil || *f.Index.Eq < *min { + min = f.Index.Eq + } + if max == nil || *f.Index.Eq > *max { + max = f.Index.Eq + } + } + } + + return min, max +} + +// MinMax function for BlockHeight +func (f *FilterTransaction) MinMaxBlockHeight() (min *int, max *int) { + // Recursively handle And conditions + if len(f.And) > 0 { + for _, subFilter := range f.And { + subMin, subMax := subFilter.MinMaxBlockHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + // Recursively handle Or conditions + if len(f.Or) > 0 { + for _, subFilter := range f.Or { + subMin, subMax := subFilter.MinMaxBlockHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + if f.BlockHeight != nil { + if f.BlockHeight.Gt != nil { + if min == nil || *f.BlockHeight.Gt < *min { + min = f.BlockHeight.Gt + } + if max == nil || *f.BlockHeight.Gt > *max { + max = f.BlockHeight.Gt + } + } + + if f.BlockHeight.Lt != nil { + if min == nil || *f.BlockHeight.Lt < *min { + min = f.BlockHeight.Lt + } + if max == nil || *f.BlockHeight.Lt > *max { + max = f.BlockHeight.Lt + } + } + + if f.BlockHeight.Eq != nil { + if min == nil || *f.BlockHeight.Eq < *min { + min = f.BlockHeight.Eq + } + if max == nil || *f.BlockHeight.Eq > *max { + max = f.BlockHeight.Eq + } + } + } + + return min, max +} + +func (f *FilterCoin) Eval(obj *Coin) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Denom field + toEvalDenom := obj.Denom + if f.Denom != nil && !f.Denom.Eval(&toEvalDenom) { + return false + } + + // Handle Amount field + toEvalAmount := toIntPtr(obj.Amount) + if f.Amount != nil && !f.Amount.Eval(toEvalAmount) { + return false + } + + return true +} + +func (f *FilterBlockTransaction) Eval(obj *BlockTransaction) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Memo field + toEvalMemo := obj.Memo + if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle Fee field + toEvalFee := obj.Fee + if f.Fee != nil && !f.Fee.Eval(toEvalFee) { + return false + } + + return true +} + +func (f *FilterBlock) Eval(obj *Block) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Version field + toEvalVersion := obj.Version() + if f.Version != nil && !f.Version.Eval(&toEvalVersion) { + return false + } + + // Handle ValidatorsHash field + toEvalValidatorsHash := obj.ValidatorsHash() + if f.ValidatorsHash != nil && !f.ValidatorsHash.Eval(&toEvalValidatorsHash) { + return false + } + + // Handle Txs slice + if f.Txs != nil { + for _, elem := range obj.Txs() { + if !f.Txs.Eval(elem) { + return false + } + } + } + + // Handle TotalTxs field + toEvalTotalTxs := toIntPtr(obj.TotalTxs()) + if f.TotalTxs != nil && !f.TotalTxs.Eval(toEvalTotalTxs) { + return false + } + + // Handle Time field + toEvalTime := obj.Time() + if f.Time != nil && !f.Time.Eval(&toEvalTime) { + return false + } + + // Handle ProposerAddressRaw field + toEvalProposerAddressRaw := obj.ProposerAddressRaw() + if f.ProposerAddressRaw != nil && !f.ProposerAddressRaw.Eval(&toEvalProposerAddressRaw) { + return false + } + + // Handle NumTxs field + toEvalNumTxs := toIntPtr(obj.NumTxs()) + if f.NumTxs != nil && !f.NumTxs.Eval(toEvalNumTxs) { + return false + } + + // Handle NextValidatorsHash field + toEvalNextValidatorsHash := obj.NextValidatorsHash() + if f.NextValidatorsHash != nil && !f.NextValidatorsHash.Eval(&toEvalNextValidatorsHash) { + return false + } + + // Handle LastResultsHash field + toEvalLastResultsHash := obj.LastResultsHash() + if f.LastResultsHash != nil && !f.LastResultsHash.Eval(&toEvalLastResultsHash) { + return false + } + + // Handle LastCommitHash field + toEvalLastCommitHash := obj.LastCommitHash() + if f.LastCommitHash != nil && !f.LastCommitHash.Eval(&toEvalLastCommitHash) { + return false + } + + // Handle LastBlockHash field + toEvalLastBlockHash := obj.LastBlockHash() + if f.LastBlockHash != nil && !f.LastBlockHash.Eval(&toEvalLastBlockHash) { + return false + } + + // Handle Height field + toEvalHeight := toIntPtr(obj.Height()) + if f.Height != nil && !f.Height.Eval(toEvalHeight) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash() + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle ConsensusHash field + toEvalConsensusHash := obj.ConsensusHash() + if f.ConsensusHash != nil && !f.ConsensusHash.Eval(&toEvalConsensusHash) { + return false + } + + // Handle ChainID field + toEvalChainID := obj.ChainID() + if f.ChainID != nil && !f.ChainID.Eval(&toEvalChainID) { + return false + } + + // Handle AppVersion field + toEvalAppVersion := obj.AppVersion() + if f.AppVersion != nil && !f.AppVersion.Eval(&toEvalAppVersion) { + return false + } + + // Handle AppHash field + toEvalAppHash := obj.AppHash() + if f.AppHash != nil && !f.AppHash.Eval(&toEvalAppHash) { + return false + } + + return true +} + +// MinMax function for Height +func (f *FilterBlock) MinMaxHeight() (min *int, max *int) { + // Recursively handle And conditions + if len(f.And) > 0 { + for _, subFilter := range f.And { + subMin, subMax := subFilter.MinMaxHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + // Recursively handle Or conditions + if len(f.Or) > 0 { + for _, subFilter := range f.Or { + subMin, subMax := subFilter.MinMaxHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + if f.Height != nil { + if f.Height.Gt != nil { + if min == nil || *f.Height.Gt < *min { + min = f.Height.Gt + } + if max == nil || *f.Height.Gt > *max { + max = f.Height.Gt + } + } + + if f.Height.Lt != nil { + if min == nil || *f.Height.Lt < *min { + min = f.Height.Lt + } + if max == nil || *f.Height.Lt > *max { + max = f.Height.Lt + } + } + + if f.Height.Eq != nil { + if min == nil || *f.Height.Eq < *min { + min = f.Height.Eq + } + if max == nil || *f.Height.Eq > *max { + max = f.Height.Eq + } + } + } + + return min, max +} + +func toIntPtr(val interface{}) *int { + if val == nil { + return nil + } + + switch v := val.(type) { + case int: + return &v + case int64: + i := int(v) + return &i + case int32: + i := int(v) + return &i + case int16: + i := int(v) + return &i + case int8: + i := int(v) + return &i + case *int: + return v + case *int64: + i := int(*v) + return &i + case *int32: + i := int(*v) + return &i + case *int16: + i := int(*v) + return &i + case *int8: + i := int(*v) + return &i + default: + return nil + } +} + +///////////////////////////////// GENERIC TYPES ///////////////////////////////// + +func (f *FilterBoolean) Eval(val *bool) bool { + if f == nil { + return true + } + + return rootEval(val, f.Exists, f.Eq, nil) +} + +func (f *FilterNumber) Eval(val *int) bool { + if f == nil { + return true + } + + if !rootEval(val, f.Exists, f.Eq, f.Neq) { + return false + } + + if val != nil && f.Gt != nil && *val <= *f.Gt { + return false + } + + if val != nil && f.Lt != nil && *val >= *f.Lt { + return false + } + + return true +} + +func (f *FilterString) Eval(val *string) bool { + if f == nil { + return true + } + + if !rootEval(val, f.Exists, f.Eq, f.Neq) { + return false + } + + if val != nil && f.Like != nil { + matched, err := regexp.MatchString(*f.Like, *val) + if err != nil || !matched { + return false + } + } + + if val != nil && f.Nlike != nil { + matched, err := regexp.MatchString(*f.Nlike, *val) + if err != nil || matched { + return false + } + } + + return true +} + +// Eval evaluates the FilterTime conditions against a given time.Time value +func (f *FilterTime) Eval(val *time.Time) bool { + if f == nil { + return true + } + + if !rootEval(val, f.Exists, f.Eq, f.Neq) { + return false + } + + // Check if the value is before the specified time + if f.Before != nil && !val.Before(*f.Before) { + return false + } + + // Check if the value is after the specified time + if f.After != nil && !val.After(*f.After) { + return false + } + + return true +} + +// rootEval is a generic function that checks if the provided value matches the filter conditions. +func rootEval[T comparable](val *T, exists *bool, eq *T, neq *T) bool { + // Check the Exists filter + if exists != nil { + if *exists && val == nil { + return false + } + if !*exists && val != nil { + return false + } + } + + // If val is nil and we reach this point, skip the following checks + if val == nil { + return true + } + + // Check the Eq filter + if eq != nil && *eq != *val { + return false + } + + // Check the Neq filter + if neq != nil && *neq == *val { + return false + } + + return true +} diff --git a/serve/graph/model/models_gen.go b/serve/graph/model/models_gen.go index 7f5010fa..8ee68b9b 100644 --- a/serve/graph/model/models_gen.go +++ b/serve/graph/model/models_gen.go @@ -117,6 +117,206 @@ type EventInput struct { Attrs []*EventAttributeInput `json:"attrs,omitempty"` } +// filter for Block objects +type FilterBlock struct { + // logical operator for Block that will combine two or more conditions, returning true if all of them are true. + And []*FilterBlock `json:"_and,omitempty"` + // logical operator for Block that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterBlock `json:"_or,omitempty"` + // logical operator for Block that will reverse conditions. + Not *FilterBlock `json:"_not,omitempty"` + // filter for hash field. + Hash *FilterString `json:"hash,omitempty"` + // filter for height field. + Height *FilterNumber `json:"height,omitempty"` + // filter for version field. + Version *FilterString `json:"version,omitempty"` + // filter for chain_id field. + ChainID *FilterString `json:"chain_id,omitempty"` + // filter for time field. + Time *FilterTime `json:"time,omitempty"` + // filter for num_txs field. + NumTxs *FilterNumber `json:"num_txs,omitempty"` + // filter for total_txs field. + TotalTxs *FilterNumber `json:"total_txs,omitempty"` + // filter for app_version field. + AppVersion *FilterString `json:"app_version,omitempty"` + // filter for last_block_hash field. + LastBlockHash *FilterString `json:"last_block_hash,omitempty"` + // filter for last_commit_hash field. + LastCommitHash *FilterString `json:"last_commit_hash,omitempty"` + // filter for validators_hash field. + ValidatorsHash *FilterString `json:"validators_hash,omitempty"` + // filter for next_validators_hash field. + NextValidatorsHash *FilterString `json:"next_validators_hash,omitempty"` + // filter for consensus_hash field. + ConsensusHash *FilterString `json:"consensus_hash,omitempty"` + // filter for app_hash field. + AppHash *FilterString `json:"app_hash,omitempty"` + // filter for last_results_hash field. + LastResultsHash *FilterString `json:"last_results_hash,omitempty"` + // filter for proposer_address_raw field. + ProposerAddressRaw *FilterString `json:"proposer_address_raw,omitempty"` + // filter for txs field. + Txs *NestedFilterBlockTransaction `json:"txs,omitempty"` +} + +// filter for BlockTransaction objects +type FilterBlockTransaction struct { + // logical operator for BlockTransaction that will combine two or more conditions, returning true if all of them are true. + And []*FilterBlockTransaction `json:"_and,omitempty"` + // logical operator for BlockTransaction that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterBlockTransaction `json:"_or,omitempty"` + // logical operator for BlockTransaction that will reverse conditions. + Not *FilterBlockTransaction `json:"_not,omitempty"` + // filter for hash field. + Hash *FilterString `json:"hash,omitempty"` + // filter for fee field. + Fee *NestedFilterTxFee `json:"fee,omitempty"` + // filter for memo field. + Memo *FilterString `json:"memo,omitempty"` +} + +// Filter type for boolean fields. All added filters here are processed as AND operators. +type FilterBoolean struct { + // Filter a boolean field checking if it exists or not. + Exists *bool `json:"exists,omitempty"` + // Filter a boolean field checking if it is equals to the specified value. + Eq *bool `json:"eq,omitempty"` +} + +// filter for Coin objects +type FilterCoin struct { + // logical operator for Coin that will combine two or more conditions, returning true if all of them are true. + And []*FilterCoin `json:"_and,omitempty"` + // logical operator for Coin that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterCoin `json:"_or,omitempty"` + // logical operator for Coin that will reverse conditions. + Not *FilterCoin `json:"_not,omitempty"` + // filter for amount field. + Amount *FilterNumber `json:"amount,omitempty"` + // filter for denom field. + Denom *FilterString `json:"denom,omitempty"` +} + +// Filter type for number fields. All added filters here are processed as AND operators. +type FilterNumber struct { + // Filter a number field checking if it exists or not. + Exists *bool `json:"exists,omitempty"` + // Filter a number field checking if it is equals to the specified value. + Eq *int `json:"eq,omitempty"` + // Filter a number field checking if it is NOT equals to the specified value. + Neq *int `json:"neq,omitempty"` + // Filter a number field checking if it is greater than the specified value. + Gt *int `json:"gt,omitempty"` + // Filter a number field checking if it is less than the specified value. + Lt *int `json:"lt,omitempty"` +} + +// Filter type for string fields. It contains a variety of filter types for string types. All added filters here are processed as AND operators. +type FilterString struct { + // Filter a string field checking if it exists or not. + Exists *bool `json:"exists,omitempty"` + // Filter a string field checking if it is equals to the specified value. + Eq *string `json:"eq,omitempty"` + // Filter a string field checking if it is NOT equals to the specified value. + Neq *string `json:"neq,omitempty"` + // Filter a string field checking if it is like the specified value. You can use standard Go RegEx expressions here. + Like *string `json:"like,omitempty"` + // Filter a string field checking if it is NOT like the specified value. You can use standard Go RegEx expressions here. + Nlike *string `json:"nlike,omitempty"` +} + +// Filter type for time fields. All added filters here are processed as AND operators. +type FilterTime struct { + // Filter a time field checking if it exists or not. + Exists *bool `json:"exists,omitempty"` + // Filter a time field checking if it is equals to the specified value. + Eq *time.Time `json:"eq,omitempty"` + // Filter a time field checking if it is NOT equals to the specified value. + Neq *time.Time `json:"neq,omitempty"` + // Filter a time field checking if it is before than the specified value. + Before *time.Time `json:"before,omitempty"` + // Filter a time field checking if it is after the specified value. + After *time.Time `json:"after,omitempty"` +} + +// filter for Transaction objects +type FilterTransaction struct { + // logical operator for Transaction that will combine two or more conditions, returning true if all of them are true. + And []*FilterTransaction `json:"_and,omitempty"` + // logical operator for Transaction that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterTransaction `json:"_or,omitempty"` + // logical operator for Transaction that will reverse conditions. + Not *FilterTransaction `json:"_not,omitempty"` + // filter for index field. + Index *FilterNumber `json:"index,omitempty"` + // filter for hash field. + Hash *FilterString `json:"hash,omitempty"` + // filter for success field. + Success *FilterBoolean `json:"success,omitempty"` + // filter for block_height field. + BlockHeight *FilterNumber `json:"block_height,omitempty"` + // filter for gas_wanted field. + GasWanted *FilterNumber `json:"gas_wanted,omitempty"` + // filter for gas_used field. + GasUsed *FilterNumber `json:"gas_used,omitempty"` + // filter for gas_fee field. + GasFee *NestedFilterCoin `json:"gas_fee,omitempty"` + // filter for messages field. + Messages *NestedFilterTransactionMessage `json:"messages,omitempty"` + // filter for memo field. + Memo *FilterString `json:"memo,omitempty"` + // filter for response field. + Response *NestedFilterTransactionResponse `json:"response,omitempty"` +} + +// filter for TransactionMessage objects +type FilterTransactionMessage struct { + // logical operator for TransactionMessage that will combine two or more conditions, returning true if all of them are true. + And []*FilterTransactionMessage `json:"_and,omitempty"` + // logical operator for TransactionMessage that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterTransactionMessage `json:"_or,omitempty"` + // logical operator for TransactionMessage that will reverse conditions. + Not *FilterTransactionMessage `json:"_not,omitempty"` + // filter for typeUrl field. + TypeURL *FilterString `json:"typeUrl,omitempty"` + // filter for route field. + Route *FilterString `json:"route,omitempty"` +} + +// filter for TransactionResponse objects +type FilterTransactionResponse struct { + // logical operator for TransactionResponse that will combine two or more conditions, returning true if all of them are true. + And []*FilterTransactionResponse `json:"_and,omitempty"` + // logical operator for TransactionResponse that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterTransactionResponse `json:"_or,omitempty"` + // logical operator for TransactionResponse that will reverse conditions. + Not *FilterTransactionResponse `json:"_not,omitempty"` + // filter for log field. + Log *FilterString `json:"log,omitempty"` + // filter for info field. + Info *FilterString `json:"info,omitempty"` + // filter for error field. + Error *FilterString `json:"error,omitempty"` + // filter for data field. + Data *FilterString `json:"data,omitempty"` +} + +// filter for TxFee objects +type FilterTxFee struct { + // logical operator for TxFee that will combine two or more conditions, returning true if all of them are true. + And []*FilterTxFee `json:"_and,omitempty"` + // logical operator for TxFee that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterTxFee `json:"_or,omitempty"` + // logical operator for TxFee that will reverse conditions. + Not *FilterTxFee `json:"_not,omitempty"` + // filter for gas_wanted field. + GasWanted *FilterNumber `json:"gas_wanted,omitempty"` + // filter for gas_fee field. + GasFee *NestedFilterCoin `json:"gas_fee,omitempty"` +} + // `GnoEvent` is the event information exported by the Gno VM. // It has `type`, `pkg_path`, `func`, and `attrs`. type GnoEvent struct { @@ -272,6 +472,82 @@ type MsgRunInput struct { Package *MemPackageInput `json:"package,omitempty"` } +// filter for BlockTransaction objects +type NestedFilterBlockTransaction struct { + // logical operator for BlockTransaction that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterBlockTransaction `json:"_and,omitempty"` + // logical operator for BlockTransaction that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterBlockTransaction `json:"_or,omitempty"` + // logical operator for BlockTransaction that will reverse conditions. + Not *NestedFilterBlockTransaction `json:"_not,omitempty"` + // filter for hash field. + Hash *FilterString `json:"hash,omitempty"` + // filter for fee field. + Fee *NestedFilterTxFee `json:"fee,omitempty"` + // filter for memo field. + Memo *FilterString `json:"memo,omitempty"` +} + +// filter for Coin objects +type NestedFilterCoin struct { + // logical operator for Coin that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterCoin `json:"_and,omitempty"` + // logical operator for Coin that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterCoin `json:"_or,omitempty"` + // logical operator for Coin that will reverse conditions. + Not *NestedFilterCoin `json:"_not,omitempty"` + // filter for amount field. + Amount *FilterNumber `json:"amount,omitempty"` + // filter for denom field. + Denom *FilterString `json:"denom,omitempty"` +} + +// filter for TransactionMessage objects +type NestedFilterTransactionMessage struct { + // logical operator for TransactionMessage that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterTransactionMessage `json:"_and,omitempty"` + // logical operator for TransactionMessage that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterTransactionMessage `json:"_or,omitempty"` + // logical operator for TransactionMessage that will reverse conditions. + Not *NestedFilterTransactionMessage `json:"_not,omitempty"` + // filter for typeUrl field. + TypeURL *FilterString `json:"typeUrl,omitempty"` + // filter for route field. + Route *FilterString `json:"route,omitempty"` +} + +// filter for TransactionResponse objects +type NestedFilterTransactionResponse struct { + // logical operator for TransactionResponse that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterTransactionResponse `json:"_and,omitempty"` + // logical operator for TransactionResponse that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterTransactionResponse `json:"_or,omitempty"` + // logical operator for TransactionResponse that will reverse conditions. + Not *NestedFilterTransactionResponse `json:"_not,omitempty"` + // filter for log field. + Log *FilterString `json:"log,omitempty"` + // filter for info field. + Info *FilterString `json:"info,omitempty"` + // filter for error field. + Error *FilterString `json:"error,omitempty"` + // filter for data field. + Data *FilterString `json:"data,omitempty"` +} + +// filter for TxFee objects +type NestedFilterTxFee struct { + // logical operator for TxFee that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterTxFee `json:"_and,omitempty"` + // logical operator for TxFee that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterTxFee `json:"_or,omitempty"` + // logical operator for TxFee that will reverse conditions. + Not *NestedFilterTxFee `json:"_not,omitempty"` + // filter for gas_wanted field. + GasWanted *FilterNumber `json:"gas_wanted,omitempty"` + // filter for gas_fee field. + GasFee *NestedFilterCoin `json:"gas_fee,omitempty"` +} + // Root Query type to fetch data about Blocks and Transactions based on filters or retrieve the latest block height. type Query struct { } @@ -375,6 +651,47 @@ type UnknownEvent struct { func (UnknownEvent) IsEvent() {} +type FilterableAddons string + +const ( + // Get minimum and maximum value used on all the filters for this field. + // Useful when you need to do a range query for performance reasons. + FilterableAddonsMinmax FilterableAddons = "MINMAX" +) + +var AllFilterableAddons = []FilterableAddons{ + FilterableAddonsMinmax, +} + +func (e FilterableAddons) IsValid() bool { + switch e { + case FilterableAddonsMinmax: + return true + } + return false +} + +func (e FilterableAddons) String() string { + return string(e) +} + +func (e *FilterableAddons) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = FilterableAddons(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid FilterableAddons", str) + } + return nil +} + +func (e FilterableAddons) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // `MessageRoute` is route type of the transactional message. // `MessageRoute` has the values of vm and bank. type MessageRoute string diff --git a/serve/graph/query.resolvers.go b/serve/graph/query.resolvers.go deleted file mode 100644 index 1abfb9a3..00000000 --- a/serve/graph/query.resolvers.go +++ /dev/null @@ -1,128 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.45 - -import ( - "context" - - "github.com/99designs/gqlgen/graphql" - "github.com/gnolang/tx-indexer/serve/graph/model" - "github.com/vektah/gqlparser/v2/gqlerror" -) - -// Transactions is the resolver for the transactions field. -func (r *queryResolver) Transactions(ctx context.Context, filter model.TransactionFilter) ([]*model.Transaction, error) { - if filter.Hash != nil { - tx, err := r.store.GetTxByHash(*filter.Hash) - if err != nil { - return nil, gqlerror.Wrap(err) - } - return []*model.Transaction{model.NewTransaction(tx)}, nil - } - - it, err := r. - store. - TxIterator( - uint64(deref(filter.FromBlockHeight)), - uint64(deref(filter.ToBlockHeight)), - uint32(deref(filter.FromIndex)), - uint32(deref(filter.ToIndex)), - ) - if err != nil { - return nil, gqlerror.Wrap(err) - } - defer it.Close() - - var out []*model.Transaction - i := 0 - for { - if i == maxElementsPerQuery { - graphql.AddErrorf(ctx, "max elements per query reached (%d)", maxElementsPerQuery) - return out, nil - } - - if !it.Next() { - return out, it.Error() - } - - select { - case <-ctx.Done(): - graphql.AddError(ctx, ctx.Err()) - return out, nil - default: - t, err := it.Value() - if err != nil { - graphql.AddError(ctx, err) - return out, nil - } - - transaction := model.NewTransaction(t) - if !FilteredTransactionBy(transaction, filter) { - continue - } - out = append(out, transaction) - i++ - } - } -} - -// Blocks is the resolver for the blocks field. -func (r *queryResolver) Blocks(ctx context.Context, filter model.BlockFilter) ([]*model.Block, error) { - it, err := r. - store. - BlockIterator( - uint64(deref(filter.FromHeight)), - uint64(deref(filter.ToHeight)), - ) - if err != nil { - return nil, gqlerror.Wrap(err) - } - defer it.Close() - - var out []*model.Block - - i := 0 - for { - if i == maxElementsPerQuery { - graphql.AddErrorf(ctx, "max elements per query reached (%d)", maxElementsPerQuery) - return out, nil - } - - if !it.Next() { - return out, it.Error() - } - - select { - case <-ctx.Done(): - graphql.AddError(ctx, ctx.Err()) - return out, nil - default: - b, err := it.Value() - if err != nil { - graphql.AddError(ctx, err) - return out, nil - } - - block := model.NewBlock(b) - if !FilteredBlockBy(block, filter) { - continue - } - - out = append(out, block) - i++ - } - } -} - -// LatestBlockHeight is the resolver for the latestBlockHeight field. -func (r *queryResolver) LatestBlockHeight(ctx context.Context) (int, error) { - h, err := r.store.GetLatestHeight() - return int(h), err -} - -// Query returns QueryResolver implementation. -func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } - -type queryResolver struct{ *Resolver } diff --git a/serve/graph/resolver.go b/serve/graph/resolver.go index 5e6a2fea..08b1de1d 100644 --- a/serve/graph/resolver.go +++ b/serve/graph/resolver.go @@ -1,4 +1,4 @@ -//go:generate go run github.com/99designs/gqlgen@v0.17.45 generate +//go:generate go run gen/generate.go package graph diff --git a/serve/graph/schema/types/block.graphql b/serve/graph/schema/types/block.graphql index 627095e1..41b12fa4 100644 --- a/serve/graph/schema/types/block.graphql +++ b/serve/graph/schema/types/block.graphql @@ -1,3 +1,4 @@ + """ Represents a blockchain block with various attributes detailing its creation and content. """ @@ -6,92 +7,92 @@ type Block { A unique identifier for the block, determined by the blockchain's header. It is computed as a Merkle tree from the header. """ - hash: String! + hash: String! @filterable """ A unique identifier for the Block determined by its position in the blockchain. This integer is strictly increasing with each new Block. """ - height: Int! + height: Int! @filterable(extras:[MINMAX]) """ The software version of the node that created this Block, indicating the specific implementation and versioning of the blockchain protocol used. """ - version: String! + version: String! @filterable """ An identifier for the specific blockchain network this Block belongs to. Helps in distinguishing between different networks like mainnet, testnet, etc. """ - chain_id: String! + chain_id: String! @filterable """ The timestamp at which this Block was proposed and finalized in the blockchain. Represented in UTC. """ - time: Time! + time: Time! @filterable """ The number of transactions this Block belongs to. """ - num_txs: Int! + num_txs: Int! @filterable """ The total number of transactions that have occurred up to this block. Indicates the total number of transactions that have occurred up to this point, even if there are no transactions in this block. """ - total_txs: Int! + total_txs: Int! @filterable """ The application's version. """ - app_version: String! + app_version: String! @filterable """ The last committed block hash. """ - last_block_hash: String! + last_block_hash: String! @filterable """ Commit hash from validators from the last block. """ - last_commit_hash: String! + last_commit_hash: String! @filterable """ Validators for the current block. """ - validators_hash: String! + validators_hash: String! @filterable """ Validators for the next block. """ - next_validators_hash: String! + next_validators_hash: String! @filterable """ Consensus params for current block. """ - consensus_hash: String! + consensus_hash: String! @filterable """ State after txs from the previous block. """ - app_hash: String! + app_hash: String! @filterable """ Root hash of all results from the txs from the previous block. """ - last_results_hash: String! + last_results_hash: String! @filterable """ Encoded data representing the blockchain address of the proposer who submitted this Block. It is raw and requires decoding to be human-readable. """ - proposer_address_raw: String! + proposer_address_raw: String! @filterable """ txs contains transactions included in the block. """ - txs: [BlockTransaction]! + txs: [BlockTransaction]! @filterable } """ @@ -101,19 +102,19 @@ type BlockTransaction { """ Hash computes the TMHASH hash of the wire encoded transaction. """ - hash: String! + hash: String! @filterable """ Fee information for the transaction. """ - fee: TxFee! + fee: TxFee! @filterable """ `memo` are string information stored within a transaction. `memo` can be utilized to find or distinguish transactions. For example, when trading a specific exchange, you would utilize the memo field of the transaction. """ - memo: String! + memo: String! @filterable """ The payload of the Transaction in a raw format, typically containing the instructions and any data necessary for execution. diff --git a/serve/graph/schema/types/transaction.graphql b/serve/graph/schema/types/transaction.graphql index 6ca1e7a8..8dd36195 100644 --- a/serve/graph/schema/types/transaction.graphql +++ b/serve/graph/schema/types/transaction.graphql @@ -5,38 +5,38 @@ type Transaction { """ A sequential index representing the order of this Transaction within its Block. Unique within the context of its Block. """ - index: Int! + index: Int! @filterable(extras:[MINMAX]) """ Hash from Transaction content in base64 encoding. """ - hash: String! + hash: String! @filterable """ The success can determine whether the transaction succeeded or failed. """ - success: Boolean! + success: Boolean! @filterable """ The height of the Block in which this Transaction is included. Links the Transaction to its containing Block. """ - block_height: Int! - + block_height: Int! @filterable(extras:[MINMAX]) + """ The declared amount of computational effort the sender is willing to pay for executing this Transaction. """ - gas_wanted: Int! + gas_wanted: Int! @filterable """ The actual amount of computational effort consumed to execute this Transaction. It could be less or equal to `gas_wanted`. """ - gas_used: Int! + gas_used: Int! @filterable """ Fee includes the amount of coins paid in fees and the maximum gas to be used by the transaction. """ - gas_fee: Coin + gas_fee: Coin @filterable """ The payload of the Transaction in a raw format, typically containing the instructions and any data necessary for execution. @@ -47,20 +47,20 @@ type Transaction { The payload of a message shows the contents of the messages in a transaction. A message consists of `router`, `type`, and `value` (whose form depends on the `router` and `type`). """ - messages: [TransactionMessage]! + messages: [TransactionMessage]! @filterable """ `memo` are string information stored within a transaction. `memo` can be utilized to find or distinguish transactions. For example, when trading a specific exchange, you would utilize the memo field of the transaction. """ - memo: String! + memo: String! @filterable """ `response` is the processing result of the transaction. It has `log`, `info`, `error`, and `data`. """ - response: TransactionResponse! + response: TransactionResponse! @filterable } """ @@ -107,13 +107,13 @@ type TransactionMessage { The type of transaction message. The value of `typeUrl` can be `send`, `exec`, `add_package`, `run`. """ - typeUrl: String! + typeUrl: String! @filterable """ The route of transaction message. The value of `route` can be `bank`, `vm`. """ - route: String! + route: String! @filterable """ MessageValue is the content of the transaction. @@ -276,12 +276,12 @@ type TxFee { """ gas limit """ - gas_wanted: Int! + gas_wanted: Int! @filterable """ The gas fee in the transaction. """ - gas_fee: Coin! + gas_fee: Coin! @filterable } """ @@ -291,12 +291,12 @@ type Coin { """ The amount of coins. """ - amount: Int! + amount: Int! @filterable """ The denomination of the coin. """ - denom: String! + denom: String! @filterable } """ @@ -307,22 +307,22 @@ type TransactionResponse { """ The log value associated with the Transaction execution, if any. """ - log: String! + log: String! @filterable """ The Info associated with the Transaction execution, if any. """ - info: String! + info: String! @filterable """ The error value associated with the Transaction execution, if any. """ - error: String! + error: String! @filterable """ The response data associated with the Transaction execution, if any. """ - data: String! + data: String! @filterable """ The emitted events associated with the transaction execution, if any. diff --git a/serve/graph/setup.go b/serve/graph/setup.go index 00cdd324..2fe8f754 100644 --- a/serve/graph/setup.go +++ b/serve/graph/setup.go @@ -1,18 +1,29 @@ package graph import ( + "context" + + "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/handler" "github.com/99designs/gqlgen/graphql/handler/transport" "github.com/99designs/gqlgen/graphql/playground" "github.com/go-chi/chi/v5" "github.com/gnolang/tx-indexer/events" + "github.com/gnolang/tx-indexer/serve/graph/model" "github.com/gnolang/tx-indexer/storage" ) func Setup(s storage.Storage, manager *events.Manager, m *chi.Mux) *chi.Mux { srv := handler.NewDefaultServer(NewExecutableSchema( - Config{Resolvers: NewResolver(s, manager)}, + Config{ + Resolvers: NewResolver(s, manager), + Directives: DirectiveRoot{ + Filterable: func(ctx context.Context, obj interface{}, next graphql.Resolver, extras []model.FilterableAddons) (res interface{}, err error) { + return next(ctx) + }, + }, + }, )) srv.AddTransport(&transport.Websocket{}) diff --git a/serve/graph/subscription.resolvers.go b/serve/graph/subscription.resolvers.go deleted file mode 100644 index 366b1636..00000000 --- a/serve/graph/subscription.resolvers.go +++ /dev/null @@ -1,39 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.45 - -import ( - "context" - - "github.com/gnolang/tx-indexer/serve/graph/model" - "github.com/gnolang/tx-indexer/types" -) - -// Transactions is the resolver for the transactions field. -func (r *subscriptionResolver) Transactions(ctx context.Context, filter model.TransactionFilter) (<-chan *model.Transaction, error) { - return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Transaction) { - for _, tx := range nb.Results { - transaction := model.NewTransaction(tx) - if FilteredTransactionBy(transaction, filter) { - c <- transaction - } - } - }), nil -} - -// Blocks is the resolver for the blocks field. -func (r *subscriptionResolver) Blocks(ctx context.Context, filter model.BlockFilter) (<-chan *model.Block, error) { - return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Block) { - block := model.NewBlock(nb.Block) - if FilteredBlockBy(block, filter) { - c <- block - } - }), nil -} - -// Subscription returns SubscriptionResolver implementation. -func (r *Resolver) Subscription() SubscriptionResolver { return &subscriptionResolver{r} } - -type subscriptionResolver struct{ *Resolver } From 570e1e306911e11885e90a3bb61fffcbe773ed75 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Tue, 10 Sep 2024 20:45:12 +0200 Subject: [PATCH 02/12] fix codegen Signed-off-by: Antonio Navarro Perez --- serve/graph/all.resolvers.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go index 5b33b7a7..d7b1b203 100644 --- a/serve/graph/all.resolvers.go +++ b/serve/graph/all.resolvers.go @@ -8,10 +8,9 @@ import ( "context" "github.com/99designs/gqlgen/graphql" - "github.com/vektah/gqlparser/v2/gqlerror" - "github.com/gnolang/tx-indexer/serve/graph/model" "github.com/gnolang/tx-indexer/types" + "github.com/vektah/gqlparser/v2/gqlerror" ) // Transactions is the resolver for the transactions field. From 8c534cc6cefefbb2c5d5325ba16b9e3343204a0c Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Tue, 17 Sep 2024 16:24:22 +0200 Subject: [PATCH 03/12] Add all fields to filters Signed-off-by: Antonio Navarro Perez --- go.mod | 2 +- go.sum | 4 +- serve/graph/all.resolvers.go | 22 + serve/graph/gen/generate.go | 54 +- serve/graph/generated.go | 5316 +++++++++++++++--- serve/graph/model/filter_methods.go | 1070 ---- serve/graph/model/filter_methods_gen.go | 2286 ++++++++ serve/graph/model/models_gen.go | 402 +- serve/graph/schema/types/transaction.graphql | 56 +- serve/graph/setup.go | 2 +- 10 files changed, 7170 insertions(+), 2044 deletions(-) delete mode 100644 serve/graph/model/filter_methods.go create mode 100644 serve/graph/model/filter_methods_gen.go diff --git a/go.mod b/go.mod index 55f297e3..dad21f01 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.7 require ( github.com/99designs/gqlgen v0.17.54 - github.com/ajnavarro/gqlfiltergen v0.0.0-20240910174730-98492f66692d + github.com/ajnavarro/gqlfiltergen v0.0.0-20240917141952-a5827c0f0dd7 github.com/cockroachdb/pebble v1.1.2 github.com/gnolang/gno v0.2.0 github.com/go-chi/chi/v5 v5.1.0 diff --git a/go.sum b/go.sum index 9912b854..585c3cd5 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,8 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240910174730-98492f66692d h1:+f629awnLtFHMIPN7Eqwzr5aX738brTJ7tnckUJszsw= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240910174730-98492f66692d/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240917141952-a5827c0f0dd7 h1:+IWeSygkYmvIfhi5YWL0nnG+/1ynL6ANvTcsYPIYwoo= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240917141952-a5827c0f0dd7/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go index d7b1b203..b47954b7 100644 --- a/serve/graph/all.resolvers.go +++ b/serve/graph/all.resolvers.go @@ -266,6 +266,28 @@ func (r *subscriptionResolver) Blocks(ctx context.Context, filter model.BlockFil }), nil } +// GetTransactions is the resolver for the getTransactions field. +func (r *subscriptionResolver) GetTransactions(ctx context.Context, filter model.FilterTransaction) (<-chan *model.Transaction, error) { + return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Transaction) { + for _, tx := range nb.Results { + transaction := model.NewTransaction(tx) + if filter.Eval(transaction) { + c <- transaction + } + } + }), nil +} + +// GetBlocks is the resolver for the getBlocks field. +func (r *subscriptionResolver) GetBlocks(ctx context.Context, filter model.FilterBlock) (<-chan *model.Block, error) { + return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Block) { + block := model.NewBlock(nb.Block) + if filter.Eval(block) { + c <- block + } + }), nil +} + // Query returns QueryResolver implementation. func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } diff --git a/serve/graph/gen/generate.go b/serve/graph/gen/generate.go index 8e4a8d0b..b96b4570 100644 --- a/serve/graph/gen/generate.go +++ b/serve/graph/gen/generate.go @@ -11,6 +11,46 @@ import ( "github.com/ajnavarro/gqlfiltergen" ) +var queriesInject string = ` +type Query { + """ + Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + """ + getBlocks(where: FilterBlock!): [Block!] + + """ + Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. + """ + getTransactions(where: FilterTransaction!): [Transaction!] +} + +type Subscription { + """ + Subscribes to real-time updates of Transactions that match the provided filter criteria. + This subscription starts immediately and only includes Transactions added to the blockchain after the subscription is active. + + This is useful for applications needing to track Transactions in real-time, such as wallets tracking incoming transactions + or analytics platforms monitoring blockchain activity. + + Returns: + - Transaction: Each received update is a Transaction object that matches the filter criteria. + """ + getTransactions(filter: FilterTransaction!): Transaction! + + """ + Subscribes to real-time updates of Blocks that match the provided filter criteria. Similar to the Transactions subscription, + this subscription is active immediately upon creation and only includes Blocks added after the subscription begins. + + This subscription is ideal for services that need to be notified of new Blocks for processing or analysis, such as block explorers, + data aggregators, or security monitoring tools. + + Returns: + - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. + """ + getBlocks(filter: FilterBlock!): Block! +} +` + func main() { cfg, err := config.LoadConfigFromDefaultLocations() if err != nil { @@ -20,19 +60,7 @@ func main() { err = api.Generate(cfg, api.AddPlugin(gqlfiltergen.NewPlugin(&gqlfiltergen.Options{ - Queries: []string{ - ` - """ - Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. - """ - getBlocks(where: FilterBlock!): [Block!] -`, ` - """ - Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. - """ - getTransactions(where: FilterTransaction!): [Transaction!] - `, - }, + InjectCodeAfter: queriesInject, })), ) if err != nil { diff --git a/serve/graph/generated.go b/serve/graph/generated.go index dc7d8d7e..4f87d55b 100644 --- a/serve/graph/generated.go +++ b/serve/graph/generated.go @@ -45,7 +45,7 @@ type ResolverRoot interface { } type DirectiveRoot struct { - Filterable func(ctx context.Context, obj interface{}, next graphql.Resolver, extras []model.FilterableAddons) (res interface{}, err error) + Filterable func(ctx context.Context, obj interface{}, next graphql.Resolver, extras []model.FilterableExtra) (res interface{}, err error) } type ComplexityRoot struct { @@ -139,8 +139,10 @@ type ComplexityRoot struct { } Subscription struct { - Blocks func(childComplexity int, filter model.BlockFilter) int - Transactions func(childComplexity int, filter model.TransactionFilter) int + Blocks func(childComplexity int, filter model.BlockFilter) int + GetBlocks func(childComplexity int, filter model.FilterBlock) int + GetTransactions func(childComplexity int, filter model.FilterTransaction) int + Transactions func(childComplexity int, filter model.TransactionFilter) int } Transaction struct { @@ -195,6 +197,8 @@ type QueryResolver interface { type SubscriptionResolver interface { Transactions(ctx context.Context, filter model.TransactionFilter) (<-chan *model.Transaction, error) Blocks(ctx context.Context, filter model.BlockFilter) (<-chan *model.Block, error) + GetTransactions(ctx context.Context, filter model.FilterTransaction) (<-chan *model.Transaction, error) + GetBlocks(ctx context.Context, filter model.FilterBlock) (<-chan *model.Block, error) } type executableSchema struct { @@ -619,6 +623,30 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Subscription.Blocks(childComplexity, args["filter"].(model.BlockFilter)), true + case "Subscription.getBlocks": + if e.complexity.Subscription.GetBlocks == nil { + break + } + + args, err := ec.field_Subscription_getBlocks_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.GetBlocks(childComplexity, args["filter"].(model.FilterBlock)), true + + case "Subscription.getTransactions": + if e.complexity.Subscription.GetTransactions == nil { + break + } + + args, err := ec.field_Subscription_getTransactions_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.GetTransactions(childComplexity, args["filter"].(model.FilterTransaction)), true + case "Subscription.transactions": if e.complexity.Subscription.Transactions == nil { break @@ -805,27 +833,49 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputBlockFilter, ec.unmarshalInputEventAttributeInput, ec.unmarshalInputEventInput, + ec.unmarshalInputFilterBankMsgSend, ec.unmarshalInputFilterBlock, ec.unmarshalInputFilterBlockTransaction, ec.unmarshalInputFilterBoolean, ec.unmarshalInputFilterCoin, - ec.unmarshalInputFilterNumber, + ec.unmarshalInputFilterEvent, + ec.unmarshalInputFilterGnoEvent, + ec.unmarshalInputFilterGnoEventAttribute, + ec.unmarshalInputFilterInt, + ec.unmarshalInputFilterMemFile, + ec.unmarshalInputFilterMemPackage, + ec.unmarshalInputFilterMessageValue, + ec.unmarshalInputFilterMsgAddPackage, + ec.unmarshalInputFilterMsgCall, + ec.unmarshalInputFilterMsgRun, ec.unmarshalInputFilterString, ec.unmarshalInputFilterTime, ec.unmarshalInputFilterTransaction, ec.unmarshalInputFilterTransactionMessage, ec.unmarshalInputFilterTransactionResponse, ec.unmarshalInputFilterTxFee, + ec.unmarshalInputFilterUnknownEvent, ec.unmarshalInputMemFileInput, ec.unmarshalInputMemPackageInput, ec.unmarshalInputMsgAddPackageInput, ec.unmarshalInputMsgCallInput, ec.unmarshalInputMsgRunInput, + ec.unmarshalInputNestedFilterBankMsgSend, ec.unmarshalInputNestedFilterBlockTransaction, ec.unmarshalInputNestedFilterCoin, + ec.unmarshalInputNestedFilterEvent, + ec.unmarshalInputNestedFilterGnoEvent, + ec.unmarshalInputNestedFilterGnoEventAttribute, + ec.unmarshalInputNestedFilterMemFile, + ec.unmarshalInputNestedFilterMemPackage, + ec.unmarshalInputNestedFilterMessageValue, + ec.unmarshalInputNestedFilterMsgAddPackage, + ec.unmarshalInputNestedFilterMsgCall, + ec.unmarshalInputNestedFilterMsgRun, ec.unmarshalInputNestedFilterTransactionMessage, ec.unmarshalInputNestedFilterTransactionResponse, ec.unmarshalInputNestedFilterTxFee, + ec.unmarshalInputNestedFilterUnknownEvent, ec.unmarshalInputTransactionBankMessageInput, ec.unmarshalInputTransactionFilter, ec.unmarshalInputTransactionMessageInput, @@ -933,7 +983,7 @@ var sources = []*ast.Source{ """ Add extra functionality to this field apart from the filtering capabilities. """ - extras: [FilterableAddons!] + extras: [FilterableExtra!] ) on FIELD_DEFINITION """ ` + "`" + `AmountInput` + "`" + ` is a range of token quantities to filter by. @@ -962,17 +1012,17 @@ type BankMsgSend { the bech32 address of the fund sender. ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` """ - from_address: String! + from_address: String! @filterable """ the bech32 address of the fund receiver. ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` """ - to_address: String! + to_address: String! @filterable """ the denomination and amount of fund sent (""). ex) ` + "`" + `1000000ugnot` + "`" + ` """ - amount: String! + amount: String! @filterable } """ ` + "`" + `BankMsgSendInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `send` + "`" + `. @@ -1172,6 +1222,35 @@ input EventInput { attrs: [EventAttributeInput!] } """ +filter for BankMsgSend objects +""" +input FilterBankMsgSend { + """ + logical operator for BankMsgSend that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterBankMsgSend] + """ + logical operator for BankMsgSend that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterBankMsgSend] + """ + logical operator for BankMsgSend that will reverse conditions. + """ + _not: FilterBankMsgSend + """ + filter for from_address field. + """ + from_address: FilterString + """ + filter for to_address field. + """ + to_address: FilterString + """ + filter for amount field. + """ + amount: FilterString +} +""" filter for Block objects """ input FilterBlock { @@ -1194,7 +1273,7 @@ input FilterBlock { """ filter for height field. """ - height: FilterNumber + height: FilterInt """ filter for version field. """ @@ -1210,11 +1289,11 @@ input FilterBlock { """ filter for num_txs field. """ - num_txs: FilterNumber + num_txs: FilterInt """ filter for total_txs field. """ - total_txs: FilterNumber + total_txs: FilterInt """ filter for app_version field. """ @@ -1317,16 +1396,99 @@ input FilterCoin { """ filter for amount field. """ - amount: FilterNumber + amount: FilterInt """ filter for denom field. """ denom: FilterString } """ +filter for Event objects +""" +input FilterEvent { + """ + logical operator for Event that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterEvent] + """ + logical operator for Event that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterEvent] + """ + logical operator for Event that will reverse conditions. + """ + _not: FilterEvent + """ + filter for GnoEvent union type. + """ + GnoEvent: NestedFilterGnoEvent + """ + filter for UnknownEvent union type. + """ + UnknownEvent: NestedFilterUnknownEvent +} +""" +filter for GnoEvent objects +""" +input FilterGnoEvent { + """ + logical operator for GnoEvent that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterGnoEvent] + """ + logical operator for GnoEvent that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterGnoEvent] + """ + logical operator for GnoEvent that will reverse conditions. + """ + _not: FilterGnoEvent + """ + filter for type field. + """ + type: FilterString + """ + filter for pkg_path field. + """ + pkg_path: FilterString + """ + filter for func field. + """ + func: FilterString + """ + filter for attrs field. + """ + attrs: NestedFilterGnoEventAttribute +} +""" +filter for GnoEventAttribute objects +""" +input FilterGnoEventAttribute { + """ + logical operator for GnoEventAttribute that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterGnoEventAttribute] + """ + logical operator for GnoEventAttribute that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterGnoEventAttribute] + """ + logical operator for GnoEventAttribute that will reverse conditions. + """ + _not: FilterGnoEventAttribute + """ + filter for key field. + """ + key: FilterString + """ + filter for value field. + """ + value: FilterString +} +""" Filter type for number fields. All added filters here are processed as AND operators. """ -input FilterNumber { +input FilterInt { """ Filter a number field checking if it exists or not. """ @@ -1349,6 +1511,188 @@ input FilterNumber { lt: Int } """ +filter for MemFile objects +""" +input FilterMemFile { + """ + logical operator for MemFile that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterMemFile] + """ + logical operator for MemFile that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterMemFile] + """ + logical operator for MemFile that will reverse conditions. + """ + _not: FilterMemFile + """ + filter for name field. + """ + name: FilterString + """ + filter for body field. + """ + body: FilterString +} +""" +filter for MemPackage objects +""" +input FilterMemPackage { + """ + logical operator for MemPackage that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterMemPackage] + """ + logical operator for MemPackage that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterMemPackage] + """ + logical operator for MemPackage that will reverse conditions. + """ + _not: FilterMemPackage + """ + filter for name field. + """ + name: FilterString + """ + filter for path field. + """ + path: FilterString + """ + filter for files field. + """ + files: NestedFilterMemFile +} +""" +filter for MessageValue objects +""" +input FilterMessageValue { + """ + logical operator for MessageValue that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterMessageValue] + """ + logical operator for MessageValue that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterMessageValue] + """ + logical operator for MessageValue that will reverse conditions. + """ + _not: FilterMessageValue + """ + filter for BankMsgSend union type. + """ + BankMsgSend: NestedFilterBankMsgSend + """ + filter for MsgCall union type. + """ + MsgCall: NestedFilterMsgCall + """ + filter for MsgAddPackage union type. + """ + MsgAddPackage: NestedFilterMsgAddPackage + """ + filter for MsgRun union type. + """ + MsgRun: NestedFilterMsgRun +} +""" +filter for MsgAddPackage objects +""" +input FilterMsgAddPackage { + """ + logical operator for MsgAddPackage that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterMsgAddPackage] + """ + logical operator for MsgAddPackage that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterMsgAddPackage] + """ + logical operator for MsgAddPackage that will reverse conditions. + """ + _not: FilterMsgAddPackage + """ + filter for creator field. + """ + creator: FilterString + """ + filter for package field. + """ + package: NestedFilterMemPackage + """ + filter for deposit field. + """ + deposit: FilterString +} +""" +filter for MsgCall objects +""" +input FilterMsgCall { + """ + logical operator for MsgCall that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterMsgCall] + """ + logical operator for MsgCall that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterMsgCall] + """ + logical operator for MsgCall that will reverse conditions. + """ + _not: FilterMsgCall + """ + filter for caller field. + """ + caller: FilterString + """ + filter for send field. + """ + send: FilterString + """ + filter for pkg_path field. + """ + pkg_path: FilterString + """ + filter for func field. + """ + func: FilterString + """ + filter for args field. + """ + args: FilterString +} +""" +filter for MsgRun objects +""" +input FilterMsgRun { + """ + logical operator for MsgRun that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterMsgRun] + """ + logical operator for MsgRun that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterMsgRun] + """ + logical operator for MsgRun that will reverse conditions. + """ + _not: FilterMsgRun + """ + filter for caller field. + """ + caller: FilterString + """ + filter for send field. + """ + send: FilterString + """ + filter for package field. + """ + package: NestedFilterMemPackage +} +""" Filter type for string fields. It contains a variety of filter types for string types. All added filters here are processed as AND operators. """ input FilterString { @@ -1417,7 +1761,7 @@ input FilterTransaction { """ filter for index field. """ - index: FilterNumber + index: FilterInt """ filter for hash field. """ @@ -1429,15 +1773,15 @@ input FilterTransaction { """ filter for block_height field. """ - block_height: FilterNumber + block_height: FilterInt """ filter for gas_wanted field. """ - gas_wanted: FilterNumber + gas_wanted: FilterInt """ filter for gas_used field. """ - gas_used: FilterNumber + gas_used: FilterInt """ filter for gas_fee field. """ @@ -1479,6 +1823,10 @@ input FilterTransactionMessage { filter for route field. """ route: FilterString + """ + filter for value field. + """ + value: NestedFilterMessageValue } """ filter for TransactionResponse objects @@ -1512,6 +1860,10 @@ input FilterTransactionResponse { filter for data field. """ data: FilterString + """ + filter for events field. + """ + events: NestedFilterEvent } """ filter for TxFee objects @@ -1532,13 +1884,34 @@ input FilterTxFee { """ filter for gas_wanted field. """ - gas_wanted: FilterNumber + gas_wanted: FilterInt """ filter for gas_fee field. """ gas_fee: NestedFilterCoin } -enum FilterableAddons { +""" +filter for UnknownEvent objects +""" +input FilterUnknownEvent { + """ + logical operator for UnknownEvent that will combine two or more conditions, returning true if all of them are true. + """ + _and: [FilterUnknownEvent] + """ + logical operator for UnknownEvent that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [FilterUnknownEvent] + """ + logical operator for UnknownEvent that will reverse conditions. + """ + _not: FilterUnknownEvent + """ + filter for value field. + """ + value: FilterString +} +enum FilterableExtra { """ Get minimum and maximum value used on all the filters for this field. Useful when you need to do a range query for performance reasons. @@ -1553,19 +1926,19 @@ type GnoEvent { """ ` + "`" + `type` + "`" + ` is the type of transaction event emitted. """ - type: String! + type: String! @filterable """ ` + "`" + `pkg_path` + "`" + ` is the path to the package that emitted the event. """ - pkg_path: String! + pkg_path: String! @filterable """ ` + "`" + `func` + "`" + ` is the name of the function that emitted the event. """ - func: String! + func: String! @filterable """ ` + "`" + `attrs` + "`" + ` is the event's attribute information. """ - attrs: [GnoEventAttribute!] + attrs: [GnoEventAttribute!] @filterable } """ ` + "`" + `GnoEventAttribute` + "`" + ` is the attributes that the event has. @@ -1575,11 +1948,11 @@ type GnoEventAttribute { """ The key of the event attribute. """ - key: String! + key: String! @filterable """ The value of the event attribute. """ - value: String! + value: String! @filterable } """ ` + "`" + `MemFile` + "`" + ` is the metadata information tied to a single gno package / realm file @@ -1588,11 +1961,11 @@ type MemFile { """ the name of the source file. """ - name: String! + name: String! @filterable """ the content of the source file. """ - body: String! + body: String! @filterable } """ ` + "`" + `MemFileInput` + "`" + ` is the metadata information tied to a single gno package / realm file. @@ -1614,15 +1987,15 @@ type MemPackage { """ the name of the package. """ - name: String! + name: String! @filterable """ the gno path of the package. """ - path: String! + path: String! @filterable """ the associated package gno source. """ - files: [MemFile!] + files: [MemFile!] @filterable } """ ` + "`" + `MemPackageInput` + "`" + ` represents a package stored in memory. @@ -1685,16 +2058,16 @@ type MsgAddPackage { the bech32 address of the package deployer. ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` """ - creator: String! + creator: String! @filterable """ the package being deployed. """ - package: MemPackage! + package: MemPackage! @filterable """ the amount of funds to be deposited at deployment, if any (""). ex) ` + "`" + `1000000ugnot` + "`" + ` """ - deposit: String! + deposit: String! @filterable } """ ` + "`" + `MsgAddPackageInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `add_package` + "`" + `. @@ -1725,24 +2098,24 @@ type MsgCall { the bech32 address of the function caller. ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` """ - caller: String! + caller: String! @filterable """ the amount of funds to be deposited to the package, if any (""). ex) ` + "`" + `1000000ugnot` + "`" + ` """ - send: String! + send: String! @filterable """ the gno package path. """ - pkg_path: String! + pkg_path: String! @filterable """ the function name being invoked. """ - func: String! + func: String! @filterable """ ` + "`" + `args` + "`" + ` are the arguments passed to the executed function. """ - args: [String!] + args: [String!] @filterable } """ ` + "`" + `MsgCallInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `exec` + "`" + `. @@ -1784,16 +2157,16 @@ type MsgRun { the bech32 address of the function caller. ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` """ - caller: String! + caller: String! @filterable """ the amount of funds to be deposited to the package, if any (""). ex) ` + "`" + `1000000ugnot` + "`" + ` """ - send: String! + send: String! @filterable """ the package being executed. """ - package: MemPackage! + package: MemPackage! @filterable } """ ` + "`" + `MsgRunInput` + "`" + ` represents input parameters required when the message type is ` + "`" + `run` + "`" + `. @@ -1816,6 +2189,35 @@ input MsgRunInput { package: MemPackageInput } """ +filter for BankMsgSend objects +""" +input NestedFilterBankMsgSend { + """ + logical operator for BankMsgSend that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterBankMsgSend] + """ + logical operator for BankMsgSend that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterBankMsgSend] + """ + logical operator for BankMsgSend that will reverse conditions. + """ + _not: NestedFilterBankMsgSend + """ + filter for from_address field. + """ + from_address: FilterString + """ + filter for to_address field. + """ + to_address: FilterString + """ + filter for amount field. + """ + amount: FilterString +} +""" filter for BlockTransaction objects """ input NestedFilterBlockTransaction { @@ -1863,127 +2265,421 @@ input NestedFilterCoin { """ filter for amount field. """ - amount: FilterNumber + amount: FilterInt """ filter for denom field. """ denom: FilterString } """ -filter for TransactionMessage objects +filter for Event objects """ -input NestedFilterTransactionMessage { +input NestedFilterEvent { """ - logical operator for TransactionMessage that will combine two or more conditions, returning true if all of them are true. + logical operator for Event that will combine two or more conditions, returning true if all of them are true. """ - _and: [NestedFilterTransactionMessage] + _and: [NestedFilterEvent] """ - logical operator for TransactionMessage that will combine two or more conditions, returning true if at least one of them is true. + logical operator for Event that will combine two or more conditions, returning true if at least one of them is true. """ - _or: [NestedFilterTransactionMessage] + _or: [NestedFilterEvent] """ - logical operator for TransactionMessage that will reverse conditions. + logical operator for Event that will reverse conditions. """ - _not: NestedFilterTransactionMessage + _not: NestedFilterEvent """ - filter for typeUrl field. + filter for GnoEvent union type. """ - typeUrl: FilterString + GnoEvent: NestedFilterGnoEvent """ - filter for route field. + filter for UnknownEvent union type. """ - route: FilterString + UnknownEvent: NestedFilterUnknownEvent } """ -filter for TransactionResponse objects +filter for GnoEvent objects """ -input NestedFilterTransactionResponse { +input NestedFilterGnoEvent { """ - logical operator for TransactionResponse that will combine two or more conditions, returning true if all of them are true. + logical operator for GnoEvent that will combine two or more conditions, returning true if all of them are true. """ - _and: [NestedFilterTransactionResponse] + _and: [NestedFilterGnoEvent] """ - logical operator for TransactionResponse that will combine two or more conditions, returning true if at least one of them is true. + logical operator for GnoEvent that will combine two or more conditions, returning true if at least one of them is true. """ - _or: [NestedFilterTransactionResponse] + _or: [NestedFilterGnoEvent] """ - logical operator for TransactionResponse that will reverse conditions. + logical operator for GnoEvent that will reverse conditions. """ - _not: NestedFilterTransactionResponse + _not: NestedFilterGnoEvent """ - filter for log field. + filter for type field. """ - log: FilterString + type: FilterString """ - filter for info field. + filter for pkg_path field. """ - info: FilterString + pkg_path: FilterString """ - filter for error field. + filter for func field. """ - error: FilterString + func: FilterString """ - filter for data field. + filter for attrs field. """ - data: FilterString + attrs: NestedFilterGnoEventAttribute } """ -filter for TxFee objects +filter for GnoEventAttribute objects """ -input NestedFilterTxFee { +input NestedFilterGnoEventAttribute { """ - logical operator for TxFee that will combine two or more conditions, returning true if all of them are true. + logical operator for GnoEventAttribute that will combine two or more conditions, returning true if all of them are true. """ - _and: [NestedFilterTxFee] + _and: [NestedFilterGnoEventAttribute] """ - logical operator for TxFee that will combine two or more conditions, returning true if at least one of them is true. + logical operator for GnoEventAttribute that will combine two or more conditions, returning true if at least one of them is true. """ - _or: [NestedFilterTxFee] + _or: [NestedFilterGnoEventAttribute] """ - logical operator for TxFee that will reverse conditions. + logical operator for GnoEventAttribute that will reverse conditions. """ - _not: NestedFilterTxFee + _not: NestedFilterGnoEventAttribute """ - filter for gas_wanted field. + filter for key field. """ - gas_wanted: FilterNumber + key: FilterString """ - filter for gas_fee field. + filter for value field. """ - gas_fee: NestedFilterCoin + value: FilterString } """ -Root Query type to fetch data about Blocks and Transactions based on filters or retrieve the latest block height. +filter for MemFile objects """ -type Query { +input NestedFilterMemFile { """ - 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. + logical operator for MemFile that will combine two or more conditions, returning true if all of them are true. """ - transactions(filter: TransactionFilter!): [Transaction!] + _and: [NestedFilterMemFile] """ - Fetches Blocks matching the specified filter criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + logical operator for MemFile that will combine two or more conditions, returning true if at least one of them is true. """ - blocks(filter: BlockFilter!): [Block!] + _or: [NestedFilterMemFile] """ - Returns the height of the most recently processed Block by the blockchain indexer, indicating the current length of the blockchain. + logical operator for MemFile that will reverse conditions. """ - latestBlockHeight: Int! + _not: NestedFilterMemFile """ - Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + filter for name field. """ - getBlocks(where: FilterBlock!): [Block!] + name: FilterString """ - Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. + filter for body field. """ - getTransactions(where: FilterTransaction!): [Transaction!] + body: FilterString } """ -Subscriptions provide a way for clients to receive real-time updates about Transactions and Blocks based on specified filter criteria. -Subscribers will only receive updates for events occurring after the subscription is established. +filter for MemPackage objects """ -type Subscription { +input NestedFilterMemPackage { """ - Subscribes to real-time updates of Transactions that match the provided filter criteria. + logical operator for MemPackage that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterMemPackage] + """ + logical operator for MemPackage that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterMemPackage] + """ + logical operator for MemPackage that will reverse conditions. + """ + _not: NestedFilterMemPackage + """ + filter for name field. + """ + name: FilterString + """ + filter for path field. + """ + path: FilterString + """ + filter for files field. + """ + files: NestedFilterMemFile +} +""" +filter for MessageValue objects +""" +input NestedFilterMessageValue { + """ + logical operator for MessageValue that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterMessageValue] + """ + logical operator for MessageValue that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterMessageValue] + """ + logical operator for MessageValue that will reverse conditions. + """ + _not: NestedFilterMessageValue + """ + filter for BankMsgSend union type. + """ + BankMsgSend: NestedFilterBankMsgSend + """ + filter for MsgCall union type. + """ + MsgCall: NestedFilterMsgCall + """ + filter for MsgAddPackage union type. + """ + MsgAddPackage: NestedFilterMsgAddPackage + """ + filter for MsgRun union type. + """ + MsgRun: NestedFilterMsgRun +} +""" +filter for MsgAddPackage objects +""" +input NestedFilterMsgAddPackage { + """ + logical operator for MsgAddPackage that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterMsgAddPackage] + """ + logical operator for MsgAddPackage that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterMsgAddPackage] + """ + logical operator for MsgAddPackage that will reverse conditions. + """ + _not: NestedFilterMsgAddPackage + """ + filter for creator field. + """ + creator: FilterString + """ + filter for package field. + """ + package: NestedFilterMemPackage + """ + filter for deposit field. + """ + deposit: FilterString +} +""" +filter for MsgCall objects +""" +input NestedFilterMsgCall { + """ + logical operator for MsgCall that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterMsgCall] + """ + logical operator for MsgCall that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterMsgCall] + """ + logical operator for MsgCall that will reverse conditions. + """ + _not: NestedFilterMsgCall + """ + filter for caller field. + """ + caller: FilterString + """ + filter for send field. + """ + send: FilterString + """ + filter for pkg_path field. + """ + pkg_path: FilterString + """ + filter for func field. + """ + func: FilterString + """ + filter for args field. + """ + args: FilterString +} +""" +filter for MsgRun objects +""" +input NestedFilterMsgRun { + """ + logical operator for MsgRun that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterMsgRun] + """ + logical operator for MsgRun that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterMsgRun] + """ + logical operator for MsgRun that will reverse conditions. + """ + _not: NestedFilterMsgRun + """ + filter for caller field. + """ + caller: FilterString + """ + filter for send field. + """ + send: FilterString + """ + filter for package field. + """ + package: NestedFilterMemPackage +} +""" +filter for TransactionMessage objects +""" +input NestedFilterTransactionMessage { + """ + logical operator for TransactionMessage that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterTransactionMessage] + """ + logical operator for TransactionMessage that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterTransactionMessage] + """ + logical operator for TransactionMessage that will reverse conditions. + """ + _not: NestedFilterTransactionMessage + """ + filter for typeUrl field. + """ + typeUrl: FilterString + """ + filter for route field. + """ + route: FilterString + """ + filter for value field. + """ + value: NestedFilterMessageValue +} +""" +filter for TransactionResponse objects +""" +input NestedFilterTransactionResponse { + """ + logical operator for TransactionResponse that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterTransactionResponse] + """ + logical operator for TransactionResponse that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterTransactionResponse] + """ + logical operator for TransactionResponse that will reverse conditions. + """ + _not: NestedFilterTransactionResponse + """ + filter for log field. + """ + log: FilterString + """ + filter for info field. + """ + info: FilterString + """ + filter for error field. + """ + error: FilterString + """ + filter for data field. + """ + data: FilterString + """ + filter for events field. + """ + events: NestedFilterEvent +} +""" +filter for TxFee objects +""" +input NestedFilterTxFee { + """ + logical operator for TxFee that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterTxFee] + """ + logical operator for TxFee that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterTxFee] + """ + logical operator for TxFee that will reverse conditions. + """ + _not: NestedFilterTxFee + """ + filter for gas_wanted field. + """ + gas_wanted: FilterInt + """ + filter for gas_fee field. + """ + gas_fee: NestedFilterCoin +} +""" +filter for UnknownEvent objects +""" +input NestedFilterUnknownEvent { + """ + logical operator for UnknownEvent that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterUnknownEvent] + """ + logical operator for UnknownEvent that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterUnknownEvent] + """ + logical operator for UnknownEvent that will reverse conditions. + """ + _not: NestedFilterUnknownEvent + """ + filter for value field. + """ + value: FilterString +} +""" +Root Query type to fetch data about Blocks and Transactions based on filters or retrieve the latest block height. +""" +type Query { + """ + 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. + """ + transactions(filter: TransactionFilter!): [Transaction!] + """ + Fetches Blocks matching the specified filter criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + """ + blocks(filter: BlockFilter!): [Block!] + """ + Returns the height of the most recently processed Block by the blockchain indexer, indicating the current length of the blockchain. + """ + latestBlockHeight: Int! + """ + Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + """ + getBlocks(where: FilterBlock!): [Block!] + """ + Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. + """ + getTransactions(where: FilterTransaction!): [Transaction!] +} +""" +Subscriptions provide a way for clients to receive real-time updates about Transactions and Blocks based on specified filter criteria. +Subscribers will only receive updates for events occurring after the subscription is established. +""" +type Subscription { + """ + Subscribes to real-time updates of Transactions that match the provided filter criteria. This subscription starts immediately and only includes Transactions added to the blockchain after the subscription is active. This is useful for applications needing to track Transactions in real-time, such as wallets tracking incoming transactions @@ -2004,6 +2700,28 @@ type Subscription { - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. """ blocks(filter: BlockFilter!): Block! + """ + Subscribes to real-time updates of Transactions that match the provided filter criteria. + This subscription starts immediately and only includes Transactions added to the blockchain after the subscription is active. + + This is useful for applications needing to track Transactions in real-time, such as wallets tracking incoming transactions + or analytics platforms monitoring blockchain activity. + + Returns: + - Transaction: Each received update is a Transaction object that matches the filter criteria. + """ + getTransactions(filter: FilterTransaction!): Transaction! + """ + Subscribes to real-time updates of Blocks that match the provided filter criteria. Similar to the Transactions subscription, + this subscription is active immediately upon creation and only includes Blocks added after the subscription begins. + + This subscription is ideal for services that need to be notified of new Blocks for processing or analysis, such as block explorers, + data aggregators, or security monitoring tools. + + Returns: + - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. + """ + getBlocks(filter: FilterBlock!): Block! } """ Field representing a point on time. It is following the RFC3339Nano format ("2006-01-02T15:04:05.999999999Z07:00") @@ -2153,7 +2871,7 @@ type TransactionMessage { MessageValue is the content of the transaction. ` + "`" + `value` + "`" + ` can be of type ` + "`" + `BankMsgSend` + "`" + `, ` + "`" + `MsgCall` + "`" + `, ` + "`" + `MsgAddPackage` + "`" + `, ` + "`" + `MsgRun` + "`" + `, ` + "`" + `UnexpectedMessage` + "`" + `. """ - value: MessageValue! + value: MessageValue! @filterable } """ Transaction's message to filter Transactions. @@ -2203,7 +2921,7 @@ type TransactionResponse { """ The emitted events associated with the transaction execution, if any. """ - events: [Event] + events: [Event] @filterable } """ ` + "`" + `TransactionVmMessageInput` + "`" + ` represents input parameters required when the message router is ` + "`" + `vm` + "`" + `. @@ -2249,7 +2967,7 @@ type UnknownEvent { """ ` + "`" + `value` + "`" + ` is a raw event string. """ - value: String! + value: String! @filterable } `, BuiltIn: false}, } @@ -2262,10 +2980,10 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) func (ec *executionContext) dir_filterable_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 []model.FilterableAddons + var arg0 []model.FilterableExtra if tmp, ok := rawArgs["extras"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("extras")) - arg0, err = ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, tmp) + arg0, err = ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, tmp) if err != nil { return nil, err } @@ -2364,6 +3082,36 @@ func (ec *executionContext) field_Subscription_blocks_args(ctx context.Context, return args, nil } +func (ec *executionContext) field_Subscription_getBlocks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.FilterBlock + if tmp, ok := rawArgs["filter"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + arg0, err = ec.unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, tmp) + if err != nil { + return nil, err + } + } + args["filter"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Subscription_getTransactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.FilterTransaction + if tmp, ok := rawArgs["filter"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + arg0, err = ec.unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, tmp) + if err != nil { + return nil, err + } + } + args["filter"] = arg0 + return args, nil +} + func (ec *executionContext) field_Subscription_transactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -2430,8 +3178,28 @@ func (ec *executionContext) _BankMsgSend_from_address(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FromAddress, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FromAddress, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -2474,8 +3242,28 @@ func (ec *executionContext) _BankMsgSend_to_address(ctx context.Context, field g } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ToAddress, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ToAddress, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -2518,8 +3306,28 @@ func (ec *executionContext) _BankMsgSend_amount(ctx context.Context, field graph } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Amount, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Amount, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -2631,7 +3439,7 @@ func (ec *executionContext) _Block_height(ctx context.Context, field graphql.Col return obj.Height(), nil } directive1 := func(ctx context.Context) (interface{}, error) { - extras, err := ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, []interface{}{"MINMAX"}) + extras, err := ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, []interface{}{"MINMAX"}) if err != nil { return nil, err } @@ -4034,8 +4842,28 @@ func (ec *executionContext) _GnoEvent_type(ctx context.Context, field graphql.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4078,8 +4906,28 @@ func (ec *executionContext) _GnoEvent_pkg_path(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PkgPath, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PkgPath, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4122,8 +4970,28 @@ func (ec *executionContext) _GnoEvent_func(ctx context.Context, field graphql.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Func, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Func, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4166,8 +5034,28 @@ func (ec *executionContext) _GnoEvent_attrs(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Attrs, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Attrs, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*model.GnoEventAttribute); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/gnolang/tx-indexer/serve/graph/model.GnoEventAttribute`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4213,8 +5101,28 @@ func (ec *executionContext) _GnoEventAttribute_key(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Key, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4257,8 +5165,28 @@ func (ec *executionContext) _GnoEventAttribute_value(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Value, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4301,8 +5229,28 @@ func (ec *executionContext) _MemFile_name(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4345,8 +5293,28 @@ func (ec *executionContext) _MemFile_body(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Body, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Body, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4389,19 +5357,39 @@ func (ec *executionContext) _MemPackage_name(ctx context.Context, field graphql. } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil } - return graphql.Null - } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } res := resTmp.(string) fc.Result = res return ec.marshalNString2string(ctx, field.Selections, res) @@ -4433,8 +5421,28 @@ func (ec *executionContext) _MemPackage_path(ctx context.Context, field graphql. } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Path, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4477,8 +5485,28 @@ func (ec *executionContext) _MemPackage_files(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Files, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Files, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]*model.MemFile); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/gnolang/tx-indexer/serve/graph/model.MemFile`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4524,8 +5552,28 @@ func (ec *executionContext) _MsgAddPackage_creator(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Creator, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Creator, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4568,8 +5616,28 @@ func (ec *executionContext) _MsgAddPackage_package(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Package, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Package, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.MemPackage); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.MemPackage`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4620,8 +5688,28 @@ func (ec *executionContext) _MsgAddPackage_deposit(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Deposit, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Deposit, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4664,8 +5752,28 @@ func (ec *executionContext) _MsgCall_caller(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Caller, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Caller, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4708,8 +5816,28 @@ func (ec *executionContext) _MsgCall_send(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Send, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Send, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4752,8 +5880,28 @@ func (ec *executionContext) _MsgCall_pkg_path(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PkgPath, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PkgPath, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4796,8 +5944,28 @@ func (ec *executionContext) _MsgCall_func(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Func, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Func, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4840,8 +6008,28 @@ func (ec *executionContext) _MsgCall_args(ctx context.Context, field graphql.Col } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4881,18 +6069,38 @@ func (ec *executionContext) _MsgRun_caller(ctx context.Context, field graphql.Co } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Caller, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Caller, nil } - return graphql.Null + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null } res := resTmp.(string) fc.Result = res @@ -4925,8 +6133,28 @@ func (ec *executionContext) _MsgRun_send(ctx context.Context, field graphql.Coll } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Send, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Send, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4969,8 +6197,28 @@ func (ec *executionContext) _MsgRun_package(ctx context.Context, field graphql.C } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Package, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Package, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.MemPackage); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.MemPackage`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -5707,204 +6955,206 @@ func (ec *executionContext) fieldContext_Subscription_blocks(ctx context.Context return fc, nil } -func (ec *executionContext) _Transaction_index(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_index(ctx, field) +func (ec *executionContext) _Subscription_getTransactions(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) { + fc, err := ec.fieldContext_Subscription_getTransactions(ctx, field) if err != nil { - return graphql.Null + return nil } ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + ret = nil } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Index(), nil - } - directive1 := func(ctx context.Context) (interface{}, error) { - extras, err := ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, []interface{}{"MINMAX"}) - if err != nil { - return nil, err - } - if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") - } - return ec.directives.Filterable(ctx, obj, directive0, extras) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(int); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().GetTransactions(rctx, fc.Args["filter"].(model.FilterTransaction)) }) if err != nil { ec.Error(ctx, err) - return graphql.Null + return nil } if resTmp == nil { if !graphql.HasFieldError(ctx, fc) { ec.Errorf(ctx, "must not be null") } - return graphql.Null + return nil + } + return func(ctx context.Context) graphql.Marshaler { + select { + case res, ok := <-resTmp.(<-chan *model.Transaction): + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalNTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransaction(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + case <-ctx.Done(): + return nil + } } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_index(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Subscription_getTransactions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Transaction", + Object: "Subscription", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "index": + return ec.fieldContext_Transaction_index(ctx, field) + case "hash": + return ec.fieldContext_Transaction_hash(ctx, field) + case "success": + return ec.fieldContext_Transaction_success(ctx, field) + case "block_height": + return ec.fieldContext_Transaction_block_height(ctx, field) + case "gas_wanted": + return ec.fieldContext_Transaction_gas_wanted(ctx, field) + case "gas_used": + return ec.fieldContext_Transaction_gas_used(ctx, field) + case "gas_fee": + return ec.fieldContext_Transaction_gas_fee(ctx, field) + case "content_raw": + return ec.fieldContext_Transaction_content_raw(ctx, field) + case "messages": + return ec.fieldContext_Transaction_messages(ctx, field) + case "memo": + return ec.fieldContext_Transaction_memo(ctx, field) + case "response": + return ec.fieldContext_Transaction_response(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Transaction", field.Name) }, } - return fc, nil -} - -func (ec *executionContext) _Transaction_hash(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_hash(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + err = ec.Recover(ctx, r) + ec.Error(ctx, err) } }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Hash(), nil - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") - } - return ec.directives.Filterable(ctx, obj, directive0, nil) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(string); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) - }) - if err != nil { + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Subscription_getTransactions_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Transaction_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Transaction", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, + return fc, err } return fc, nil } -func (ec *executionContext) _Transaction_success(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_success(ctx, field) +func (ec *executionContext) _Subscription_getBlocks(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) { + fc, err := ec.fieldContext_Subscription_getBlocks(ctx, field) if err != nil { - return graphql.Null + return nil } ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null + ret = nil } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Success(), nil - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") - } - return ec.directives.Filterable(ctx, obj, directive0, nil) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().GetBlocks(rctx, fc.Args["filter"].(model.FilterBlock)) }) if err != nil { ec.Error(ctx, err) - return graphql.Null + return nil } if resTmp == nil { if !graphql.HasFieldError(ctx, fc) { ec.Errorf(ctx, "must not be null") } - return graphql.Null + return nil } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} + return func(ctx context.Context) graphql.Marshaler { + select { + case res, ok := <-resTmp.(<-chan *model.Block): + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalNBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlock(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + case <-ctx.Done(): + return nil + } + } +} -func (ec *executionContext) fieldContext_Transaction_success(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Subscription_getBlocks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Transaction", + Object: "Subscription", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "hash": + return ec.fieldContext_Block_hash(ctx, field) + case "height": + return ec.fieldContext_Block_height(ctx, field) + case "version": + return ec.fieldContext_Block_version(ctx, field) + case "chain_id": + return ec.fieldContext_Block_chain_id(ctx, field) + case "time": + return ec.fieldContext_Block_time(ctx, field) + case "num_txs": + return ec.fieldContext_Block_num_txs(ctx, field) + case "total_txs": + return ec.fieldContext_Block_total_txs(ctx, field) + case "app_version": + return ec.fieldContext_Block_app_version(ctx, field) + case "last_block_hash": + return ec.fieldContext_Block_last_block_hash(ctx, field) + case "last_commit_hash": + return ec.fieldContext_Block_last_commit_hash(ctx, field) + case "validators_hash": + return ec.fieldContext_Block_validators_hash(ctx, field) + case "next_validators_hash": + return ec.fieldContext_Block_next_validators_hash(ctx, field) + case "consensus_hash": + return ec.fieldContext_Block_consensus_hash(ctx, field) + case "app_hash": + return ec.fieldContext_Block_app_hash(ctx, field) + case "last_results_hash": + return ec.fieldContext_Block_last_results_hash(ctx, field) + case "proposer_address_raw": + return ec.fieldContext_Block_proposer_address_raw(ctx, field) + case "txs": + return ec.fieldContext_Block_txs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Block", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Subscription_getBlocks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Transaction_block_height(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_block_height(ctx, field) +func (ec *executionContext) _Transaction_index(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_index(ctx, field) if err != nil { return graphql.Null } @@ -5918,10 +7168,10 @@ func (ec *executionContext) _Transaction_block_height(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.BlockHeight(), nil + return obj.Index(), nil } directive1 := func(ctx context.Context) (interface{}, error) { - extras, err := ec.unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx, []interface{}{"MINMAX"}) + extras, err := ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, []interface{}{"MINMAX"}) if err != nil { return nil, err } @@ -5958,7 +7208,7 @@ func (ec *executionContext) _Transaction_block_height(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_block_height(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_index(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -5971,8 +7221,8 @@ func (ec *executionContext) fieldContext_Transaction_block_height(_ context.Cont return fc, nil } -func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_gas_wanted(ctx, field) +func (ec *executionContext) _Transaction_hash(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_hash(ctx, field) if err != nil { return graphql.Null } @@ -5986,7 +7236,7 @@ func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.GasWanted(), nil + return obj.Hash(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6002,10 +7252,10 @@ func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field g if tmp == nil { return nil, nil } - if data, ok := tmp.(int); ok { + if data, ok := tmp.(string); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6017,26 +7267,26 @@ func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field g } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_gas_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_gas_used(ctx, field) +func (ec *executionContext) _Transaction_success(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_success(ctx, field) if err != nil { return graphql.Null } @@ -6050,7 +7300,7 @@ func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.GasUsed(), nil + return obj.Success(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6066,10 +7316,10 @@ func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.(int); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6081,26 +7331,26 @@ func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(int) + res := resTmp.(bool) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_gas_used(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_success(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Transaction_gas_fee(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_gas_fee(ctx, field) +func (ec *executionContext) _Transaction_block_height(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_block_height(ctx, field) if err != nil { return graphql.Null } @@ -6114,13 +7364,17 @@ func (ec *executionContext) _Transaction_gas_fee(ctx context.Context, field grap resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.GasFee(), nil + return obj.BlockHeight(), nil } directive1 := func(ctx context.Context) (interface{}, error) { + extras, err := ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, []interface{}{"MINMAX"}) + if err != nil { + return nil, err + } if ec.directives.Filterable == nil { return nil, errors.New("directive filterable is not implemented") } - return ec.directives.Filterable(ctx, obj, directive0, nil) + return ec.directives.Filterable(ctx, obj, directive0, extras) } tmp, err := directive1(rctx) @@ -6130,57 +7384,10 @@ func (ec *executionContext) _Transaction_gas_fee(ctx context.Context, field grap if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.Coin); ok { + if data, ok := tmp.(int); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.Coin`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.Coin) - fc.Result = res - return ec.marshalOCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Transaction_gas_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Transaction", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "amount": - return ec.fieldContext_Coin_amount(ctx, field) - case "denom": - return ec.fieldContext_Coin_denom(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Transaction_content_raw(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_content_raw(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ContentRaw(), nil + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6192,26 +7399,26 @@ func (ec *executionContext) _Transaction_content_raw(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_content_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_block_height(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Transaction_messages(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_messages(ctx, field) +func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_gas_wanted(ctx, field) if err != nil { return graphql.Null } @@ -6225,7 +7432,7 @@ func (ec *executionContext) _Transaction_messages(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Messages(), nil + return obj.GasWanted(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6241,10 +7448,10 @@ func (ec *executionContext) _Transaction_messages(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.([]*model.TransactionMessage); ok { + if data, ok := tmp.(int); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/gnolang/tx-indexer/serve/graph/model.TransactionMessage`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6256,34 +7463,26 @@ func (ec *executionContext) _Transaction_messages(ctx context.Context, field gra } return graphql.Null } - res := resTmp.([]*model.TransactionMessage) + res := resTmp.(int) fc.Result = res - return ec.marshalNTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessage(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_messages(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_gas_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "typeUrl": - return ec.fieldContext_TransactionMessage_typeUrl(ctx, field) - case "route": - return ec.fieldContext_TransactionMessage_route(ctx, field) - case "value": - return ec.fieldContext_TransactionMessage_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TransactionMessage", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_memo(ctx, field) +func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_gas_used(ctx, field) if err != nil { return graphql.Null } @@ -6297,7 +7496,7 @@ func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Memo(), nil + return obj.GasUsed(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6313,10 +7512,10 @@ func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql if tmp == nil { return nil, nil } - if data, ok := tmp.(string); ok { + if data, ok := tmp.(int); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6328,26 +7527,26 @@ func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_memo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_gas_used(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Transaction_response(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Transaction_response(ctx, field) +func (ec *executionContext) _Transaction_gas_fee(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_gas_fee(ctx, field) if err != nil { return graphql.Null } @@ -6361,7 +7560,7 @@ func (ec *executionContext) _Transaction_response(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Response(), nil + return obj.GasFee(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6377,27 +7576,24 @@ func (ec *executionContext) _Transaction_response(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.TransactionResponse); ok { + if data, ok := tmp.(*model.Coin); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.TransactionResponse`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.Coin`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*model.TransactionResponse) + res := resTmp.(*model.Coin) fc.Result = res - return ec.marshalNTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionResponse(ctx, field.Selections, res) + return ec.marshalOCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Transaction_response(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_gas_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -6405,25 +7601,19 @@ func (ec *executionContext) fieldContext_Transaction_response(_ context.Context, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "log": - return ec.fieldContext_TransactionResponse_log(ctx, field) - case "info": - return ec.fieldContext_TransactionResponse_info(ctx, field) - case "error": - return ec.fieldContext_TransactionResponse_error(ctx, field) - case "data": - return ec.fieldContext_TransactionResponse_data(ctx, field) - case "events": - return ec.fieldContext_TransactionResponse_events(ctx, field) + case "amount": + return ec.fieldContext_Coin_amount(ctx, field) + case "denom": + return ec.fieldContext_Coin_denom(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type TransactionResponse", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) }, } return fc, nil } -func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, field graphql.CollectedField, obj *model.TransactionMessage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionMessage_typeUrl(ctx, field) +func (ec *executionContext) _Transaction_content_raw(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_content_raw(ctx, field) if err != nil { return graphql.Null } @@ -6435,28 +7625,8 @@ func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TypeURL, nil - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") - } - return ec.directives.Filterable(ctx, obj, directive0, nil) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(string); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.ContentRaw(), nil }) if err != nil { ec.Error(ctx, err) @@ -6473,11 +7643,11 @@ func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionMessage_typeUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_content_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TransactionMessage", + Object: "Transaction", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -6486,8 +7656,8 @@ func (ec *executionContext) fieldContext_TransactionMessage_typeUrl(_ context.Co return fc, nil } -func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field graphql.CollectedField, obj *model.TransactionMessage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionMessage_route(ctx, field) +func (ec *executionContext) _Transaction_messages(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_messages(ctx, field) if err != nil { return graphql.Null } @@ -6501,7 +7671,7 @@ func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Route, nil + return obj.Messages(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6517,10 +7687,10 @@ func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(string); ok { + if data, ok := tmp.([]*model.TransactionMessage); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/gnolang/tx-indexer/serve/graph/model.TransactionMessage`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6532,26 +7702,34 @@ func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.TransactionMessage) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessage(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionMessage_route(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_messages(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TransactionMessage", + Object: "Transaction", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "typeUrl": + return ec.fieldContext_TransactionMessage_typeUrl(ctx, field) + case "route": + return ec.fieldContext_TransactionMessage_route(ctx, field) + case "value": + return ec.fieldContext_TransactionMessage_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TransactionMessage", field.Name) }, } return fc, nil } -func (ec *executionContext) _TransactionMessage_value(ctx context.Context, field graphql.CollectedField, obj *model.TransactionMessage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionMessage_value(ctx, field) +func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_memo(ctx, field) if err != nil { return graphql.Null } @@ -6563,8 +7741,28 @@ func (ec *executionContext) _TransactionMessage_value(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Value, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Memo(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6576,26 +7774,26 @@ func (ec *executionContext) _TransactionMessage_value(ctx context.Context, field } return graphql.Null } - res := resTmp.(model.MessageValue) + res := resTmp.(string) fc.Result = res - return ec.marshalNMessageValue2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageValue(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionMessage_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_memo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TransactionMessage", + Object: "Transaction", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type MessageValue does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionResponse_log(ctx, field) +func (ec *executionContext) _Transaction_response(ctx context.Context, field graphql.CollectedField, obj *model.Transaction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Transaction_response(ctx, field) if err != nil { return graphql.Null } @@ -6609,7 +7807,7 @@ func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Log(), nil + return obj.Response(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6625,10 +7823,10 @@ func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(string); ok { + if data, ok := tmp.(*model.TransactionResponse); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.TransactionResponse`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6640,26 +7838,38 @@ func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.TransactionResponse) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionResponse(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_log(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Transaction_response(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TransactionResponse", + Object: "Transaction", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "log": + return ec.fieldContext_TransactionResponse_log(ctx, field) + case "info": + return ec.fieldContext_TransactionResponse_info(ctx, field) + case "error": + return ec.fieldContext_TransactionResponse_error(ctx, field) + case "data": + return ec.fieldContext_TransactionResponse_data(ctx, field) + case "events": + return ec.fieldContext_TransactionResponse_events(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TransactionResponse", field.Name) }, } return fc, nil } -func (ec *executionContext) _TransactionResponse_info(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionResponse_info(ctx, field) +func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, field graphql.CollectedField, obj *model.TransactionMessage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionMessage_typeUrl(ctx, field) if err != nil { return graphql.Null } @@ -6673,7 +7883,7 @@ func (ec *executionContext) _TransactionResponse_info(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Info(), nil + return obj.TypeURL, nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6709,11 +7919,11 @@ func (ec *executionContext) _TransactionResponse_info(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_info(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionMessage_typeUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TransactionResponse", + Object: "TransactionMessage", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -6722,8 +7932,8 @@ func (ec *executionContext) fieldContext_TransactionResponse_info(_ context.Cont return fc, nil } -func (ec *executionContext) _TransactionResponse_error(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionResponse_error(ctx, field) +func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field graphql.CollectedField, obj *model.TransactionMessage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionMessage_route(ctx, field) if err != nil { return graphql.Null } @@ -6737,7 +7947,7 @@ func (ec *executionContext) _TransactionResponse_error(ctx context.Context, fiel resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Error(), nil + return obj.Route, nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6773,11 +7983,11 @@ func (ec *executionContext) _TransactionResponse_error(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_error(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionMessage_route(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TransactionResponse", + Object: "TransactionMessage", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -6786,8 +7996,8 @@ func (ec *executionContext) fieldContext_TransactionResponse_error(_ context.Con return fc, nil } -func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionResponse_data(ctx, field) +func (ec *executionContext) _TransactionMessage_value(ctx context.Context, field graphql.CollectedField, obj *model.TransactionMessage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionMessage_value(ctx, field) if err != nil { return graphql.Null } @@ -6801,7 +8011,7 @@ func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Data(), nil + return obj.Value, nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6817,10 +8027,10 @@ func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(string); ok { + if data, ok := tmp.(model.MessageValue); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be github.com/gnolang/tx-indexer/serve/graph/model.MessageValue`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6832,26 +8042,26 @@ func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(model.MessageValue) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNMessageValue2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageValue(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionMessage_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TransactionResponse", + Object: "TransactionMessage", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type MessageValue does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TransactionResponse_events(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionResponse_events(ctx, field) +func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionResponse_log(ctx, field) if err != nil { return graphql.Null } @@ -6863,36 +8073,59 @@ func (ec *executionContext) _TransactionResponse_events(ctx context.Context, fie } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Events(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Log(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]model.Event) + res := resTmp.(string) fc.Result = res - return ec.marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TransactionResponse_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_log(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionResponse", Field: field, IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Event does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql.CollectedField, obj *model.TxFee) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TxFee_gas_wanted(ctx, field) +func (ec *executionContext) _TransactionResponse_info(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionResponse_info(ctx, field) if err != nil { return graphql.Null } @@ -6906,7 +8139,7 @@ func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.GasWanted, nil + return obj.Info(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6922,10 +8155,10 @@ func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql if tmp == nil { return nil, nil } - if data, ok := tmp.(int); ok { + if data, ok := tmp.(string); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -6937,26 +8170,26 @@ func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TxFee_gas_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_info(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TxFee", + Object: "TransactionResponse", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.CollectedField, obj *model.TxFee) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TxFee_gas_fee(ctx, field) +func (ec *executionContext) _TransactionResponse_error(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionResponse_error(ctx, field) if err != nil { return graphql.Null } @@ -6970,7 +8203,7 @@ func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.Co resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.GasFee, nil + return obj.Error(), nil } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { @@ -6986,10 +8219,10 @@ func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.Co if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.Coin); ok { + if data, ok := tmp.(string); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.Coin`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -7001,32 +8234,26 @@ func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(*model.Coin) + res := resTmp.(string) fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_TxFee_gas_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_error(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "TxFee", + Object: "TransactionResponse", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "amount": - return ec.fieldContext_Coin_amount(ctx, field) - case "denom": - return ec.fieldContext_Coin_denom(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _UnexpectedMessage_raw(ctx context.Context, field graphql.CollectedField, obj *model.UnexpectedMessage) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UnexpectedMessage_raw(ctx, field) +func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionResponse_data(ctx, field) if err != nil { return graphql.Null } @@ -7038,8 +8265,28 @@ func (ec *executionContext) _UnexpectedMessage_raw(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Raw, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Data(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -7056,11 +8303,11 @@ func (ec *executionContext) _UnexpectedMessage_raw(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UnexpectedMessage_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UnexpectedMessage", + Object: "TransactionResponse", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -7069,8 +8316,8 @@ func (ec *executionContext) fieldContext_UnexpectedMessage_raw(_ context.Context return fc, nil } -func (ec *executionContext) _UnknownEvent_value(ctx context.Context, field graphql.CollectedField, obj *model.UnknownEvent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_UnknownEvent_value(ctx, field) +func (ec *executionContext) _TransactionResponse_events(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TransactionResponse_events(ctx, field) if err != nil { return graphql.Null } @@ -7082,39 +8329,56 @@ func (ec *executionContext) _UnknownEvent_value(ctx context.Context, field graph } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Value, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Events(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]model.Event); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []github.com/gnolang/tx-indexer/serve/graph/model.Event`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]model.Event) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UnknownEvent_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TransactionResponse_events(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UnknownEvent", + Object: "TransactionResponse", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Event does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql.CollectedField, obj *model.TxFee) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TxFee_gas_wanted(ctx, field) if err != nil { return graphql.Null } @@ -7126,8 +8390,28 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GasWanted, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(int); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be int`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -7139,26 +8423,26 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TxFee_gas_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "TxFee", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.CollectedField, obj *model.TxFee) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TxFee_gas_fee(ctx, field) if err != nil { return graphql.Null } @@ -7170,36 +8454,65 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.GasFee, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Coin); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/gnolang/tx-indexer/serve/graph/model.Coin`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Coin) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_TxFee_gas_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "TxFee", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "amount": + return ec.fieldContext_Coin_amount(ctx, field) + case "denom": + return ec.fieldContext_Coin_denom(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) _UnexpectedMessage_raw(ctx context.Context, field graphql.CollectedField, obj *model.UnexpectedMessage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UnexpectedMessage_raw(ctx, field) if err != nil { return graphql.Null } @@ -7212,7 +8525,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.Raw, nil }) if err != nil { ec.Error(ctx, err) @@ -7224,26 +8537,26 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(string) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UnexpectedMessage_raw(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UnexpectedMessage", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) _UnknownEvent_value(ctx context.Context, field graphql.CollectedField, obj *model.UnknownEvent) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UnknownEvent_value(ctx, field) if err != nil { return graphql.Null } @@ -7255,8 +8568,28 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + return nil, errors.New("directive filterable is not implemented") + } + return ec.directives.Filterable(ctx, obj, directive0, nil) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(string); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -7268,36 +8601,26 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(string) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UnknownEvent_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "UnknownEvent", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { return graphql.Null } @@ -7310,7 +8633,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -7322,25 +8645,208 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { fc, err := ec.fieldContext___EnumValue_name(ctx, field) if err != nil { return graphql.Null @@ -9098,6 +10604,68 @@ func (ec *executionContext) unmarshalInputEventInput(ctx context.Context, obj in return it, nil } +func (ec *executionContext) unmarshalInputFilterBankMsgSend(ctx context.Context, obj interface{}) (model.FilterBankMsgSend, error) { + var it model.FilterBankMsgSend + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "from_address", "to_address", "amount"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "from_address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_address")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.FromAddress = data + case "to_address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_address")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.ToAddress = data + case "amount": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amount")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Amount = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputFilterBlock(ctx context.Context, obj interface{}) (model.FilterBlock, error) { var it model.FilterBlock asMap := map[string]interface{}{} @@ -9142,7 +10710,7 @@ func (ec *executionContext) unmarshalInputFilterBlock(ctx context.Context, obj i it.Hash = data case "height": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("height")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) if err != nil { return it, err } @@ -9170,14 +10738,14 @@ func (ec *executionContext) unmarshalInputFilterBlock(ctx context.Context, obj i it.Time = data case "num_txs": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("num_txs")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) if err != nil { return it, err } it.NumTxs = data case "total_txs": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("total_txs")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) if err != nil { return it, err } @@ -9391,7 +10959,7 @@ func (ec *executionContext) unmarshalInputFilterCoin(ctx context.Context, obj in it.Not = data case "amount": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amount")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) if err != nil { return it, err } @@ -9409,36 +10977,215 @@ func (ec *executionContext) unmarshalInputFilterCoin(ctx context.Context, obj in return it, nil } -func (ec *executionContext) unmarshalInputFilterNumber(ctx context.Context, obj interface{}) (model.FilterNumber, error) { - var it model.FilterNumber +func (ec *executionContext) unmarshalInputFilterEvent(ctx context.Context, obj interface{}) (model.FilterEvent, error) { + var it model.FilterEvent asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"exists", "eq", "neq", "gt", "lt"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "GnoEvent", "UnknownEvent"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "exists": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterEvent(ctx, v) if err != nil { return it, err } - it.Exists = data - case "eq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterEvent(ctx, v) if err != nil { return it, err } - it.Eq = data - case "neq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterEvent(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "GnoEvent": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("GnoEvent")) + data, err := ec.unmarshalONestedFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx, v) + if err != nil { + return it, err + } + it.GnoEvent = data + case "UnknownEvent": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("UnknownEvent")) + data, err := ec.unmarshalONestedFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx, v) + if err != nil { + return it, err + } + it.UnknownEvent = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterGnoEvent(ctx context.Context, obj interface{}) (model.FilterGnoEvent, error) { + var it model.FilterGnoEvent + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "type", "pkg_path", "func", "attrs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterGnoEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEvent(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterGnoEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEvent(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEvent(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "type": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Type = data + case "pkg_path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.PkgPath = data + case "func": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Func = data + case "attrs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attrs")) + data, err := ec.unmarshalONestedFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx, v) + if err != nil { + return it, err + } + it.Attrs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterGnoEventAttribute(ctx context.Context, obj interface{}) (model.FilterGnoEventAttribute, error) { + var it model.FilterGnoEventAttribute + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "key", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "key": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Key = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Value = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterInt(ctx context.Context, obj interface{}) (model.FilterInt, error) { + var it model.FilterInt + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"exists", "eq", "neq", "gt", "lt"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "exists": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Exists = data + case "eq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.Eq = data + case "neq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) data, err := ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err @@ -9464,124 +11211,1136 @@ func (ec *executionContext) unmarshalInputFilterNumber(ctx context.Context, obj return it, nil } -func (ec *executionContext) unmarshalInputFilterString(ctx context.Context, obj interface{}) (model.FilterString, error) { - var it model.FilterString +func (ec *executionContext) unmarshalInputFilterMemFile(ctx context.Context, obj interface{}) (model.FilterMemFile, error) { + var it model.FilterMemFile asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"exists", "eq", "neq", "like", "nlike"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "name", "body"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "exists": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemFile(ctx, v) if err != nil { return it, err } - it.Exists = data - case "eq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemFile(ctx, v) if err != nil { return it, err } - it.Eq = data - case "neq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemFile(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "body": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Body = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterMemPackage(ctx context.Context, obj interface{}) (model.FilterMemPackage, error) { + var it model.FilterMemPackage + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "name", "path", "files"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterMemPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterMemPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Path = data + case "files": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("files")) + data, err := ec.unmarshalONestedFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx, v) + if err != nil { + return it, err + } + it.Files = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterMessageValue(ctx context.Context, obj interface{}) (model.FilterMessageValue, error) { + var it model.FilterMessageValue + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "BankMsgSend", "MsgCall", "MsgAddPackage", "MsgRun"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMessageValue(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMessageValue(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMessageValue(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "BankMsgSend": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("BankMsgSend")) + data, err := ec.unmarshalONestedFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx, v) + if err != nil { + return it, err + } + it.BankMsgSend = data + case "MsgCall": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("MsgCall")) + data, err := ec.unmarshalONestedFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx, v) + if err != nil { + return it, err + } + it.MsgCall = data + case "MsgAddPackage": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("MsgAddPackage")) + data, err := ec.unmarshalONestedFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx, v) + if err != nil { + return it, err + } + it.MsgAddPackage = data + case "MsgRun": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("MsgRun")) + data, err := ec.unmarshalONestedFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx, v) + if err != nil { + return it, err + } + it.MsgRun = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterMsgAddPackage(ctx context.Context, obj interface{}) (model.FilterMsgAddPackage, error) { + var it model.FilterMsgAddPackage + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "creator", "package", "deposit"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterMsgAddPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgAddPackage(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterMsgAddPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgAddPackage(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgAddPackage(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "creator": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("creator")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Creator = data + case "package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) + data, err := ec.unmarshalONestedFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.Package = data + case "deposit": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deposit")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Deposit = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterMsgCall(ctx context.Context, obj interface{}) (model.FilterMsgCall, error) { + var it model.FilterMsgCall + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "caller", "send", "pkg_path", "func", "args"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterMsgCall2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterMsgCall2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Send = data + case "pkg_path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.PkgPath = data + case "func": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Func = data + case "args": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Args = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterMsgRun(ctx context.Context, obj interface{}) (model.FilterMsgRun, error) { + var it model.FilterMsgRun + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "caller", "send", "package"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterMsgRun2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgRun(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterMsgRun2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgRun(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgRun(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Send = data + case "package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) + data, err := ec.unmarshalONestedFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.Package = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterString(ctx context.Context, obj interface{}) (model.FilterString, error) { + var it model.FilterString + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"exists", "eq", "neq", "like", "nlike"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "exists": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Exists = data + case "eq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Eq = data + case "neq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Neq = data + case "like": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("like")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Like = data + case "nlike": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nlike")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Nlike = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTime(ctx context.Context, obj interface{}) (model.FilterTime, error) { + var it model.FilterTime + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"exists", "eq", "neq", "before", "after"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "exists": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Exists = data + case "eq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Eq = data + case "neq": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Neq = data + case "before": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.Before = data + case "after": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + it.After = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTransaction(ctx context.Context, obj interface{}) (model.FilterTransaction, error) { + var it model.FilterTransaction + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "index", "hash", "success", "block_height", "gas_wanted", "gas_used", "gas_fee", "messages", "memo", "response"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "index": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("index")) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) + if err != nil { + return it, err + } + it.Index = data + case "hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Hash = data + case "success": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("success")) + data, err := ec.unmarshalOFilterBoolean2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBoolean(ctx, v) + if err != nil { + return it, err + } + it.Success = data + case "block_height": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("block_height")) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) + if err != nil { + return it, err + } + it.BlockHeight = data + case "gas_wanted": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) + if err != nil { + return it, err + } + it.GasWanted = data + case "gas_used": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_used")) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) + if err != nil { + return it, err + } + it.GasUsed = data + case "gas_fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_fee")) + data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.GasFee = data + case "messages": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("messages")) + data, err := ec.unmarshalONestedFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Messages = data + case "memo": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Memo = data + case "response": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("response")) + data, err := ec.unmarshalONestedFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Response = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTransactionMessage(ctx context.Context, obj interface{}) (model.FilterTransactionMessage, error) { + var it model.FilterTransactionMessage + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "typeUrl", "route", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "typeUrl": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeUrl")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.TypeURL = data + case "route": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("route")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Route = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalONestedFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx, v) + if err != nil { + return it, err + } + it.Value = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTransactionResponse(ctx context.Context, obj interface{}) (model.FilterTransactionResponse, error) { + var it model.FilterTransactionResponse + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "log", "info", "error", "data", "events"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "log": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("log")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Log = data + case "info": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("info")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Info = data + case "error": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("error")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Error = data + case "data": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Data = data + case "events": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("events")) + data, err := ec.unmarshalONestedFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx, v) + if err != nil { + return it, err + } + it.Events = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterTxFee(ctx context.Context, obj interface{}) (model.FilterTxFee, error) { + var it model.FilterTxFee + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "gas_wanted", "gas_fee"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "gas_wanted": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) + if err != nil { + return it, err + } + it.GasWanted = data + case "gas_fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_fee")) + data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + if err != nil { + return it, err + } + it.GasFee = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFilterUnknownEvent(ctx context.Context, obj interface{}) (model.FilterUnknownEvent, error) { + var it model.FilterUnknownEvent + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalOFilterUnknownEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterUnknownEvent(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalOFilterUnknownEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterUnknownEvent(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalOFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterUnknownEvent(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Value = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMemFileInput(ctx context.Context, obj interface{}) (model.MemFileInput, error) { + var it model.MemFileInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "body"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "body": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Body = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMemPackageInput(ctx context.Context, obj interface{}) (model.MemPackageInput, error) { + var it model.MemPackageInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "path", "files"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Path = data + case "files": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("files")) + data, err := ec.unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx, v) + if err != nil { + return it, err + } + it.Files = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMsgAddPackageInput(ctx context.Context, obj interface{}) (model.MsgAddPackageInput, error) { + var it model.MsgAddPackageInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"creator", "package", "deposit"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "creator": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("creator")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Creator = data + case "package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) + data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) + if err != nil { + return it, err + } + it.Package = data + case "deposit": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deposit")) + data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + if err != nil { + return it, err + } + it.Deposit = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMsgCallInput(ctx context.Context, obj interface{}) (model.MsgCallInput, error) { + var it model.MsgCallInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"caller", "send", "pkg_path", "func", "args"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + if err != nil { + return it, err + } + it.Send = data + case "pkg_path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PkgPath = data + case "func": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Func = data + case "args": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Args = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMsgRunInput(ctx context.Context, obj interface{}) (model.MsgRunInput, error) { + var it model.MsgRunInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"caller", "send", "package"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } - it.Neq = data - case "like": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("like")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) if err != nil { return it, err } - it.Like = data - case "nlike": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nlike")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Send = data + case "package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) + data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) if err != nil { return it, err } - it.Nlike = data + it.Package = data } } return it, nil } -func (ec *executionContext) unmarshalInputFilterTime(ctx context.Context, obj interface{}) (model.FilterTime, error) { - var it model.FilterTime +func (ec *executionContext) unmarshalInputNestedFilterBankMsgSend(ctx context.Context, obj interface{}) (model.NestedFilterBankMsgSend, error) { + var it model.NestedFilterBankMsgSend asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"exists", "eq", "neq", "before", "after"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "from_address", "to_address", "amount"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "exists": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exists")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx, v) if err != nil { return it, err } - it.Exists = data - case "eq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx, v) if err != nil { return it, err } - it.Eq = data - case "neq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx, v) if err != nil { return it, err } - it.Neq = data - case "before": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + it.Not = data + case "from_address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_address")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Before = data - case "after": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + it.FromAddress = data + case "to_address": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_address")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.After = data + it.ToAddress = data + case "amount": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amount")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Amount = data } } return it, nil } -func (ec *executionContext) unmarshalInputFilterTransaction(ctx context.Context, obj interface{}) (model.FilterTransaction, error) { - var it model.FilterTransaction +func (ec *executionContext) unmarshalInputNestedFilterBlockTransaction(ctx context.Context, obj interface{}) (model.NestedFilterBlockTransaction, error) { + var it model.NestedFilterBlockTransaction asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "index", "hash", "success", "block_height", "gas_wanted", "gas_used", "gas_fee", "messages", "memo", "response"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "hash", "fee", "memo"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -9590,32 +12349,25 @@ func (ec *executionContext) unmarshalInputFilterTransaction(ctx context.Context, switch k { case "_and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) - data, err := ec.unmarshalOFilterTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + data, err := ec.unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) if err != nil { return it, err } it.And = data case "_or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) - data, err := ec.unmarshalOFilterTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + data, err := ec.unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) if err != nil { return it, err } it.Or = data case "_not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) - data, err := ec.unmarshalOFilterTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, v) + data, err := ec.unmarshalONestedFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) if err != nil { return it, err } it.Not = data - case "index": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("index")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) - if err != nil { - return it, err - } - it.Index = data case "hash": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) @@ -9623,76 +12375,89 @@ func (ec *executionContext) unmarshalInputFilterTransaction(ctx context.Context, return it, err } it.Hash = data - case "success": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("success")) - data, err := ec.unmarshalOFilterBoolean2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBoolean(ctx, v) + case "fee": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fee")) + data, err := ec.unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, v) if err != nil { return it, err } - it.Success = data - case "block_height": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("block_height")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + it.Fee = data + case "memo": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.BlockHeight = data - case "gas_wanted": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + it.Memo = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNestedFilterCoin(ctx context.Context, obj interface{}) (model.NestedFilterCoin, error) { + var it model.NestedFilterCoin + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "amount", "denom"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) if err != nil { return it, err } - it.GasWanted = data - case "gas_used": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_used")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) if err != nil { return it, err } - it.GasUsed = data - case "gas_fee": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_fee")) + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) if err != nil { return it, err } - it.GasFee = data - case "messages": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("messages")) - data, err := ec.unmarshalONestedFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx, v) + it.Not = data + case "amount": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amount")) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) if err != nil { return it, err } - it.Messages = data - case "memo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + it.Amount = data + case "denom": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("denom")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Memo = data - case "response": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("response")) - data, err := ec.unmarshalONestedFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionResponse(ctx, v) - if err != nil { - return it, err - } - it.Response = data + it.Denom = data } } return it, nil } -func (ec *executionContext) unmarshalInputFilterTransactionMessage(ctx context.Context, obj interface{}) (model.FilterTransactionMessage, error) { - var it model.FilterTransactionMessage +func (ec *executionContext) unmarshalInputNestedFilterEvent(ctx context.Context, obj interface{}) (model.NestedFilterEvent, error) { + var it model.NestedFilterEvent asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "typeUrl", "route"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "GnoEvent", "UnknownEvent"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -9701,53 +12466,53 @@ func (ec *executionContext) unmarshalInputFilterTransactionMessage(ctx context.C switch k { case "_and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) - data, err := ec.unmarshalOFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + data, err := ec.unmarshalONestedFilterEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx, v) if err != nil { return it, err } it.And = data case "_or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) - data, err := ec.unmarshalOFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + data, err := ec.unmarshalONestedFilterEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx, v) if err != nil { return it, err } it.Or = data case "_not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) - data, err := ec.unmarshalOFilterTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionMessage(ctx, v) + data, err := ec.unmarshalONestedFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx, v) if err != nil { return it, err } it.Not = data - case "typeUrl": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("typeUrl")) - data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + case "GnoEvent": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("GnoEvent")) + data, err := ec.unmarshalONestedFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx, v) if err != nil { return it, err } - it.TypeURL = data - case "route": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("route")) - data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + it.GnoEvent = data + case "UnknownEvent": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("UnknownEvent")) + data, err := ec.unmarshalONestedFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx, v) if err != nil { return it, err } - it.Route = data + it.UnknownEvent = data } } return it, nil } -func (ec *executionContext) unmarshalInputFilterTransactionResponse(ctx context.Context, obj interface{}) (model.FilterTransactionResponse, error) { - var it model.FilterTransactionResponse +func (ec *executionContext) unmarshalInputNestedFilterGnoEvent(ctx context.Context, obj interface{}) (model.NestedFilterGnoEvent, error) { + var it model.NestedFilterGnoEvent asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "log", "info", "error", "data"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "type", "pkg_path", "func", "attrs"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -9756,67 +12521,67 @@ func (ec *executionContext) unmarshalInputFilterTransactionResponse(ctx context. switch k { case "_and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) - data, err := ec.unmarshalOFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + data, err := ec.unmarshalONestedFilterGnoEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx, v) if err != nil { return it, err } it.And = data case "_or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) - data, err := ec.unmarshalOFilterTransactionResponse2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + data, err := ec.unmarshalONestedFilterGnoEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx, v) if err != nil { return it, err } it.Or = data case "_not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) - data, err := ec.unmarshalOFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, v) + data, err := ec.unmarshalONestedFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx, v) if err != nil { return it, err } it.Not = data - case "log": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("log")) + case "type": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Log = data - case "info": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("info")) + it.Type = data + case "pkg_path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Info = data - case "error": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("error")) + it.PkgPath = data + case "func": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Error = data - case "data": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("data")) - data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + it.Func = data + case "attrs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attrs")) + data, err := ec.unmarshalONestedFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx, v) if err != nil { return it, err } - it.Data = data + it.Attrs = data } } return it, nil } -func (ec *executionContext) unmarshalInputFilterTxFee(ctx context.Context, obj interface{}) (model.FilterTxFee, error) { - var it model.FilterTxFee +func (ec *executionContext) unmarshalInputNestedFilterGnoEventAttribute(ctx context.Context, obj interface{}) (model.NestedFilterGnoEventAttribute, error) { + var it model.NestedFilterGnoEventAttribute asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "gas_wanted", "gas_fee"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "key", "value"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -9825,69 +12590,90 @@ func (ec *executionContext) unmarshalInputFilterTxFee(ctx context.Context, obj i switch k { case "_and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) - data, err := ec.unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + data, err := ec.unmarshalONestedFilterGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx, v) if err != nil { return it, err } it.And = data case "_or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) - data, err := ec.unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + data, err := ec.unmarshalONestedFilterGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx, v) if err != nil { return it, err } it.Or = data case "_not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) - data, err := ec.unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, v) + data, err := ec.unmarshalONestedFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx, v) if err != nil { return it, err } it.Not = data - case "gas_wanted": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + case "key": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.GasWanted = data - case "gas_fee": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_fee")) - data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + it.Key = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.GasFee = data + it.Value = data } } return it, nil } -func (ec *executionContext) unmarshalInputMemFileInput(ctx context.Context, obj interface{}) (model.MemFileInput, error) { - var it model.MemFileInput +func (ec *executionContext) unmarshalInputNestedFilterMemFile(ctx context.Context, obj interface{}) (model.NestedFilterMemFile, error) { + var it model.NestedFilterMemFile asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"name", "body"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "name", "body"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx, v) + if err != nil { + return it, err + } + it.Not = data case "name": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } it.Name = data case "body": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("body")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } @@ -9898,37 +12684,58 @@ func (ec *executionContext) unmarshalInputMemFileInput(ctx context.Context, obj return it, nil } -func (ec *executionContext) unmarshalInputMemPackageInput(ctx context.Context, obj interface{}) (model.MemPackageInput, error) { - var it model.MemPackageInput +func (ec *executionContext) unmarshalInputNestedFilterMemPackage(ctx context.Context, obj interface{}) (model.NestedFilterMemPackage, error) { + var it model.NestedFilterMemPackage asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"name", "path", "files"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "name", "path", "files"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterMemPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterMemPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.Not = data case "name": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } it.Name = data case "path": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } it.Path = data case "files": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("files")) - data, err := ec.unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx, v) + data, err := ec.unmarshalONestedFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx, v) if err != nil { return it, err } @@ -9939,151 +12746,145 @@ func (ec *executionContext) unmarshalInputMemPackageInput(ctx context.Context, o return it, nil } -func (ec *executionContext) unmarshalInputMsgAddPackageInput(ctx context.Context, obj interface{}) (model.MsgAddPackageInput, error) { - var it model.MsgAddPackageInput +func (ec *executionContext) unmarshalInputNestedFilterMessageValue(ctx context.Context, obj interface{}) (model.NestedFilterMessageValue, error) { + var it model.NestedFilterMessageValue asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"creator", "package", "deposit"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "BankMsgSend", "MsgCall", "MsgAddPackage", "MsgRun"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "creator": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("creator")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.Creator = data - case "package": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) - data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx, v) if err != nil { return it, err } - it.Package = data - case "deposit": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deposit")) - data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx, v) if err != nil { return it, err } - it.Deposit = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputMsgCallInput(ctx context.Context, obj interface{}) (model.MsgCallInput, error) { - var it model.MsgCallInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"caller", "send", "pkg_path", "func", "args"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "caller": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx, v) if err != nil { return it, err } - it.Caller = data - case "send": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) - data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + it.Not = data + case "BankMsgSend": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("BankMsgSend")) + data, err := ec.unmarshalONestedFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx, v) if err != nil { return it, err } - it.Send = data - case "pkg_path": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.BankMsgSend = data + case "MsgCall": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("MsgCall")) + data, err := ec.unmarshalONestedFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx, v) if err != nil { return it, err } - it.PkgPath = data - case "func": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.MsgCall = data + case "MsgAddPackage": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("MsgAddPackage")) + data, err := ec.unmarshalONestedFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx, v) if err != nil { return it, err } - it.Func = data - case "args": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + it.MsgAddPackage = data + case "MsgRun": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("MsgRun")) + data, err := ec.unmarshalONestedFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx, v) if err != nil { return it, err } - it.Args = data + it.MsgRun = data } } return it, nil } -func (ec *executionContext) unmarshalInputMsgRunInput(ctx context.Context, obj interface{}) (model.MsgRunInput, error) { - var it model.MsgRunInput +func (ec *executionContext) unmarshalInputNestedFilterMsgAddPackage(ctx context.Context, obj interface{}) (model.NestedFilterMsgAddPackage, error) { + var it model.NestedFilterMsgAddPackage asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"caller", "send", "package"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "creator", "package", "deposit"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "caller": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterMsgAddPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx, v) if err != nil { return it, err } - it.Caller = data - case "send": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) - data, err := ec.unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx, v) + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterMsgAddPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx, v) if err != nil { return it, err } - it.Send = data + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "creator": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("creator")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Creator = data case "package": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) - data, err := ec.unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx, v) + data, err := ec.unmarshalONestedFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, v) if err != nil { return it, err } it.Package = data + case "deposit": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deposit")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Deposit = data } } return it, nil } -func (ec *executionContext) unmarshalInputNestedFilterBlockTransaction(ctx context.Context, obj interface{}) (model.NestedFilterBlockTransaction, error) { - var it model.NestedFilterBlockTransaction +func (ec *executionContext) unmarshalInputNestedFilterMsgCall(ctx context.Context, obj interface{}) (model.NestedFilterMsgCall, error) { + var it model.NestedFilterMsgCall asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "hash", "fee", "memo"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "caller", "send", "pkg_path", "func", "args"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -10092,60 +12893,74 @@ func (ec *executionContext) unmarshalInputNestedFilterBlockTransaction(ctx conte switch k { case "_and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) - data, err := ec.unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) + data, err := ec.unmarshalONestedFilterMsgCall2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx, v) if err != nil { return it, err } it.And = data case "_or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) - data, err := ec.unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) + data, err := ec.unmarshalONestedFilterMsgCall2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx, v) if err != nil { return it, err } it.Or = data case "_not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) - data, err := ec.unmarshalONestedFilterBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx, v) + data, err := ec.unmarshalONestedFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx, v) if err != nil { return it, err } it.Not = data - case "hash": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Hash = data - case "fee": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fee")) - data, err := ec.unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTxFee(ctx, v) + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Fee = data - case "memo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + it.Send = data + case "pkg_path": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pkg_path")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Memo = data + it.PkgPath = data + case "func": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Func = data + case "args": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Args = data } } return it, nil } -func (ec *executionContext) unmarshalInputNestedFilterCoin(ctx context.Context, obj interface{}) (model.NestedFilterCoin, error) { - var it model.NestedFilterCoin +func (ec *executionContext) unmarshalInputNestedFilterMsgRun(ctx context.Context, obj interface{}) (model.NestedFilterMsgRun, error) { + var it model.NestedFilterMsgRun asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "amount", "denom"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "caller", "send", "package"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -10154,39 +12969,46 @@ func (ec *executionContext) unmarshalInputNestedFilterCoin(ctx context.Context, switch k { case "_and": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) - data, err := ec.unmarshalONestedFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + data, err := ec.unmarshalONestedFilterMsgRun2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx, v) if err != nil { return it, err } it.And = data case "_or": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) - data, err := ec.unmarshalONestedFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + data, err := ec.unmarshalONestedFilterMsgRun2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx, v) if err != nil { return it, err } it.Or = data case "_not": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) - data, err := ec.unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterCoin(ctx, v) + data, err := ec.unmarshalONestedFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx, v) if err != nil { return it, err } it.Not = data - case "amount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amount")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + case "caller": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("caller")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Amount = data - case "denom": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("denom")) + it.Caller = data + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) if err != nil { return it, err } - it.Denom = data + it.Send = data + case "package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) + data, err := ec.unmarshalONestedFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, v) + if err != nil { + return it, err + } + it.Package = data } } @@ -10200,7 +13022,7 @@ func (ec *executionContext) unmarshalInputNestedFilterTransactionMessage(ctx con asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "typeUrl", "route"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "typeUrl", "route", "value"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -10242,6 +13064,13 @@ func (ec *executionContext) unmarshalInputNestedFilterTransactionMessage(ctx con return it, err } it.Route = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalONestedFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx, v) + if err != nil { + return it, err + } + it.Value = data } } @@ -10255,7 +13084,7 @@ func (ec *executionContext) unmarshalInputNestedFilterTransactionResponse(ctx co asMap[k] = v } - fieldsInOrder := [...]string{"_and", "_or", "_not", "log", "info", "error", "data"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "log", "info", "error", "data", "events"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -10311,6 +13140,13 @@ func (ec *executionContext) unmarshalInputNestedFilterTransactionResponse(ctx co return it, err } it.Data = data + case "events": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("events")) + data, err := ec.unmarshalONestedFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx, v) + if err != nil { + return it, err + } + it.Events = data } } @@ -10354,7 +13190,7 @@ func (ec *executionContext) unmarshalInputNestedFilterTxFee(ctx context.Context, it.Not = data case "gas_wanted": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gas_wanted")) - data, err := ec.unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx, v) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx, v) if err != nil { return it, err } @@ -10372,6 +13208,54 @@ func (ec *executionContext) unmarshalInputNestedFilterTxFee(ctx context.Context, return it, nil } +func (ec *executionContext) unmarshalInputNestedFilterUnknownEvent(ctx context.Context, obj interface{}) (model.NestedFilterUnknownEvent, error) { + var it model.NestedFilterUnknownEvent + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"_and", "_or", "_not", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "_and": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_and")) + data, err := ec.unmarshalONestedFilterUnknownEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx, v) + if err != nil { + return it, err + } + it.And = data + case "_or": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_or")) + data, err := ec.unmarshalONestedFilterUnknownEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx, v) + if err != nil { + return it, err + } + it.Or = data + case "_not": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_not")) + data, err := ec.unmarshalONestedFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx, v) + if err != nil { + return it, err + } + it.Not = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalOFilterString2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterString(ctx, v) + if err != nil { + return it, err + } + it.Value = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputTransactionBankMessageInput(ctx context.Context, obj interface{}) (model.TransactionBankMessageInput, error) { var it model.TransactionBankMessageInput asMap := map[string]interface{}{} @@ -11444,6 +14328,10 @@ func (ec *executionContext) _Subscription(ctx context.Context, sel ast.Selection return ec._Subscription_transactions(ctx, fields[0]) case "blocks": return ec._Subscription_blocks(ctx, fields[0]) + case "getTransactions": + return ec._Subscription_getTransactions(ctx, fields[0]) + case "getBlocks": + return ec._Subscription_getBlocks(ctx, fields[0]) default: panic("unknown field " + strconv.Quote(fields[0].Name)) } @@ -12190,13 +15078,13 @@ func (ec *executionContext) unmarshalNFilterTransaction2githubᚗcomᚋgnolang return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx context.Context, v interface{}) (model.FilterableAddons, error) { - var res model.FilterableAddons +func (ec *executionContext) unmarshalNFilterableExtra2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtra(ctx context.Context, v interface{}) (model.FilterableExtra, error) { + var res model.FilterableExtra err := res.UnmarshalGQL(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx context.Context, sel ast.SelectionSet, v model.FilterableAddons) graphql.Marshaler { +func (ec *executionContext) marshalNFilterableExtra2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtra(ctx context.Context, sel ast.SelectionSet, v model.FilterableExtra) graphql.Marshaler { return v } @@ -12826,6 +15714,34 @@ func (ec *executionContext) unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋ return res, nil } +func (ec *executionContext) unmarshalOFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(ctx context.Context, v interface{}) ([]*model.FilterBankMsgSend, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterBankMsgSend, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(ctx context.Context, v interface{}) (*model.FilterBankMsgSend, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterBankMsgSend(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOFilterBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx context.Context, v interface{}) ([]*model.FilterBlock, error) { if v == nil { return nil, nil @@ -12918,11 +15834,263 @@ func (ec *executionContext) unmarshalOFilterCoin2ᚖgithubᚗcomᚋgnolangᚋtx return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOFilterNumber2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterNumber(ctx context.Context, v interface{}) (*model.FilterNumber, error) { +func (ec *executionContext) unmarshalOFilterEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterEvent(ctx context.Context, v interface{}) ([]*model.FilterEvent, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterEvent, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterEvent(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterEvent(ctx context.Context, v interface{}) (*model.FilterEvent, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterEvent(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterGnoEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEvent(ctx context.Context, v interface{}) ([]*model.FilterGnoEvent, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterGnoEvent, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEvent(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEvent(ctx context.Context, v interface{}) (*model.FilterGnoEvent, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterGnoEvent(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx context.Context, v interface{}) ([]*model.FilterGnoEventAttribute, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterGnoEventAttribute, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx context.Context, v interface{}) (*model.FilterGnoEventAttribute, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterGnoEventAttribute(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(ctx context.Context, v interface{}) (*model.FilterInt, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterInt(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemFile(ctx context.Context, v interface{}) ([]*model.FilterMemFile, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterMemFile, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemFile(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemFile(ctx context.Context, v interface{}) (*model.FilterMemFile, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterMemFile(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterMemPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemPackage(ctx context.Context, v interface{}) ([]*model.FilterMemPackage, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterMemPackage, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemPackage(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMemPackage(ctx context.Context, v interface{}) (*model.FilterMemPackage, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterMemPackage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMessageValue(ctx context.Context, v interface{}) ([]*model.FilterMessageValue, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterMessageValue, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMessageValue(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMessageValue(ctx context.Context, v interface{}) (*model.FilterMessageValue, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterMessageValue(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterMsgAddPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgAddPackage(ctx context.Context, v interface{}) ([]*model.FilterMsgAddPackage, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterMsgAddPackage, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgAddPackage(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgAddPackage(ctx context.Context, v interface{}) (*model.FilterMsgAddPackage, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterMsgAddPackage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterMsgCall2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx context.Context, v interface{}) ([]*model.FilterMsgCall, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterMsgCall, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx context.Context, v interface{}) (*model.FilterMsgCall, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterMsgCall(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterMsgRun2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgRun(ctx context.Context, v interface{}) ([]*model.FilterMsgRun, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterMsgRun, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgRun(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgRun(ctx context.Context, v interface{}) (*model.FilterMsgRun, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputFilterNumber(ctx, v) + res, err := ec.unmarshalInputFilterMsgRun(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } @@ -13038,7 +16206,35 @@ func (ec *executionContext) unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolang res := make([]*model.FilterTxFee, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, vSlice[i]) + res[i], err = ec.unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx context.Context, v interface{}) (*model.FilterTxFee, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFilterTxFee(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFilterUnknownEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterUnknownEvent(ctx context.Context, v interface{}) ([]*model.FilterUnknownEvent, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FilterUnknownEvent, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterUnknownEvent(ctx, vSlice[i]) if err != nil { return nil, err } @@ -13046,15 +16242,15 @@ func (ec *executionContext) unmarshalOFilterTxFee2ᚕᚖgithubᚗcomᚋgnolang return res, nil } -func (ec *executionContext) unmarshalOFilterTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTxFee(ctx context.Context, v interface{}) (*model.FilterTxFee, error) { +func (ec *executionContext) unmarshalOFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterUnknownEvent(ctx context.Context, v interface{}) (*model.FilterUnknownEvent, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputFilterTxFee(ctx, v) + res, err := ec.unmarshalInputFilterUnknownEvent(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx context.Context, v interface{}) ([]model.FilterableAddons, error) { +func (ec *executionContext) unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx context.Context, v interface{}) ([]model.FilterableExtra, error) { if v == nil { return nil, nil } @@ -13063,10 +16259,10 @@ func (ec *executionContext) unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolang vSlice = graphql.CoerceList(v) } var err error - res := make([]model.FilterableAddons, len(vSlice)) + res := make([]model.FilterableExtra, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx, vSlice[i]) + res[i], err = ec.unmarshalNFilterableExtra2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtra(ctx, vSlice[i]) if err != nil { return nil, err } @@ -13074,7 +16270,7 @@ func (ec *executionContext) unmarshalOFilterableAddons2ᚕgithubᚗcomᚋgnolang return res, nil } -func (ec *executionContext) marshalOFilterableAddons2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddonsᚄ(ctx context.Context, sel ast.SelectionSet, v []model.FilterableAddons) graphql.Marshaler { +func (ec *executionContext) marshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx context.Context, sel ast.SelectionSet, v []model.FilterableExtra) graphql.Marshaler { if v == nil { return graphql.Null } @@ -13101,7 +16297,7 @@ func (ec *executionContext) marshalOFilterableAddons2ᚕgithubᚗcomᚋgnolang if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNFilterableAddons2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableAddons(ctx, sel, v[i]) + ret[i] = ec.marshalNFilterableExtra2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtra(ctx, sel, v[i]) } if isLen1 { f(i) @@ -13323,6 +16519,34 @@ func (ec *executionContext) unmarshalOMsgRunInput2ᚖgithubᚗcomᚋgnolangᚋtx return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalONestedFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx context.Context, v interface{}) ([]*model.NestedFilterBankMsgSend, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterBankMsgSend, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterBankMsgSend2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx context.Context, v interface{}) (*model.NestedFilterBankMsgSend, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterBankMsgSend(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalONestedFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBlockTransaction(ctx context.Context, v interface{}) ([]*model.NestedFilterBlockTransaction, error) { if v == nil { return nil, nil @@ -13379,6 +16603,258 @@ func (ec *executionContext) unmarshalONestedFilterCoin2ᚖgithubᚗcomᚋgnolang return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalONestedFilterEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx context.Context, v interface{}) ([]*model.NestedFilterEvent, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterEvent, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(ctx context.Context, v interface{}) (*model.NestedFilterEvent, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterEvent(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterGnoEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx context.Context, v interface{}) ([]*model.NestedFilterGnoEvent, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterGnoEvent, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(ctx context.Context, v interface{}) (*model.NestedFilterGnoEvent, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterGnoEvent(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx context.Context, v interface{}) ([]*model.NestedFilterGnoEventAttribute, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterGnoEventAttribute, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx context.Context, v interface{}) (*model.NestedFilterGnoEventAttribute, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterGnoEventAttribute(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx context.Context, v interface{}) ([]*model.NestedFilterMemFile, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterMemFile, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx context.Context, v interface{}) (*model.NestedFilterMemFile, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterMemFile(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterMemPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx context.Context, v interface{}) ([]*model.NestedFilterMemPackage, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterMemPackage, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemPackage(ctx context.Context, v interface{}) (*model.NestedFilterMemPackage, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterMemPackage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx context.Context, v interface{}) ([]*model.NestedFilterMessageValue, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterMessageValue, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterMessageValue2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx context.Context, v interface{}) (*model.NestedFilterMessageValue, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterMessageValue(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterMsgAddPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx context.Context, v interface{}) ([]*model.NestedFilterMsgAddPackage, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterMsgAddPackage, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterMsgAddPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx context.Context, v interface{}) (*model.NestedFilterMsgAddPackage, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterMsgAddPackage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterMsgCall2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx context.Context, v interface{}) ([]*model.NestedFilterMsgCall, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterMsgCall, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(ctx context.Context, v interface{}) (*model.NestedFilterMsgCall, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterMsgCall(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalONestedFilterMsgRun2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx context.Context, v interface{}) ([]*model.NestedFilterMsgRun, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterMsgRun, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx context.Context, v interface{}) (*model.NestedFilterMsgRun, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterMsgRun(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalONestedFilterTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterTransactionMessage(ctx context.Context, v interface{}) ([]*model.NestedFilterTransactionMessage, error) { if v == nil { return nil, nil @@ -13463,6 +16939,34 @@ func (ec *executionContext) unmarshalONestedFilterTxFee2ᚖgithubᚗcomᚋgnolan return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalONestedFilterUnknownEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx context.Context, v interface{}) ([]*model.NestedFilterUnknownEvent, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.NestedFilterUnknownEvent, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalONestedFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalONestedFilterUnknownEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterUnknownEvent(ctx context.Context, v interface{}) (*model.NestedFilterUnknownEvent, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputNestedFilterUnknownEvent(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { if v == nil { return nil, nil diff --git a/serve/graph/model/filter_methods.go b/serve/graph/model/filter_methods.go deleted file mode 100644 index 4c5c9372..00000000 --- a/serve/graph/model/filter_methods.go +++ /dev/null @@ -1,1070 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package model - -import ( - "regexp" - "time" -) - -///////////////////////////////// CUSTOM TYPES ///////////////////////////////// - -func (f *NestedFilterTxFee) Eval(obj *TxFee) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle GasWanted field - toEvalGasWanted := toIntPtr(obj.GasWanted) - if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { - return false - } - - // Handle GasFee field - toEvalGasFee := obj.GasFee - if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { - return false - } - - return true -} - -func (f *NestedFilterTransactionResponse) Eval(obj *TransactionResponse) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Log field - toEvalLog := obj.Log() - if f.Log != nil && !f.Log.Eval(&toEvalLog) { - return false - } - - // Handle Info field - toEvalInfo := obj.Info() - if f.Info != nil && !f.Info.Eval(&toEvalInfo) { - return false - } - - // Handle Error field - toEvalError := obj.Error() - if f.Error != nil && !f.Error.Eval(&toEvalError) { - return false - } - - // Handle Data field - toEvalData := obj.Data() - if f.Data != nil && !f.Data.Eval(&toEvalData) { - return false - } - - return true -} - -func (f *NestedFilterTransactionMessage) Eval(obj *TransactionMessage) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle TypeURL field - toEvalTypeURL := obj.TypeURL - if f.TypeURL != nil && !f.TypeURL.Eval(&toEvalTypeURL) { - return false - } - - // Handle Route field - toEvalRoute := obj.Route - if f.Route != nil && !f.Route.Eval(&toEvalRoute) { - return false - } - - return true -} - -func (f *NestedFilterCoin) Eval(obj *Coin) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Denom field - toEvalDenom := obj.Denom - if f.Denom != nil && !f.Denom.Eval(&toEvalDenom) { - return false - } - - // Handle Amount field - toEvalAmount := toIntPtr(obj.Amount) - if f.Amount != nil && !f.Amount.Eval(toEvalAmount) { - return false - } - - return true -} - -func (f *NestedFilterBlockTransaction) Eval(obj *BlockTransaction) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Memo field - toEvalMemo := obj.Memo - if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { - return false - } - - // Handle Hash field - toEvalHash := obj.Hash - if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { - return false - } - - // Handle Fee field - toEvalFee := obj.Fee - if f.Fee != nil && !f.Fee.Eval(toEvalFee) { - return false - } - - return true -} - -func (f *FilterTxFee) Eval(obj *TxFee) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle GasWanted field - toEvalGasWanted := toIntPtr(obj.GasWanted) - if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { - return false - } - - // Handle GasFee field - toEvalGasFee := obj.GasFee - if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { - return false - } - - return true -} - -func (f *FilterTransactionResponse) Eval(obj *TransactionResponse) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Log field - toEvalLog := obj.Log() - if f.Log != nil && !f.Log.Eval(&toEvalLog) { - return false - } - - // Handle Info field - toEvalInfo := obj.Info() - if f.Info != nil && !f.Info.Eval(&toEvalInfo) { - return false - } - - // Handle Error field - toEvalError := obj.Error() - if f.Error != nil && !f.Error.Eval(&toEvalError) { - return false - } - - // Handle Data field - toEvalData := obj.Data() - if f.Data != nil && !f.Data.Eval(&toEvalData) { - return false - } - - return true -} - -func (f *FilterTransactionMessage) Eval(obj *TransactionMessage) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle TypeURL field - toEvalTypeURL := obj.TypeURL - if f.TypeURL != nil && !f.TypeURL.Eval(&toEvalTypeURL) { - return false - } - - // Handle Route field - toEvalRoute := obj.Route - if f.Route != nil && !f.Route.Eval(&toEvalRoute) { - return false - } - - return true -} - -func (f *FilterTransaction) Eval(obj *Transaction) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Success field - toEvalSuccess := obj.Success() - if f.Success != nil && !f.Success.Eval(&toEvalSuccess) { - return false - } - - // Handle Response field - toEvalResponse := obj.Response() - if f.Response != nil && !f.Response.Eval(toEvalResponse) { - return false - } - - // Handle Messages slice - if f.Messages != nil { - for _, elem := range obj.Messages() { - if !f.Messages.Eval(elem) { - return false - } - } - } - - // Handle Memo field - toEvalMemo := obj.Memo() - if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { - return false - } - - // Handle Index field - toEvalIndex := toIntPtr(obj.Index()) - if f.Index != nil && !f.Index.Eval(toEvalIndex) { - return false - } - - // Handle Hash field - toEvalHash := obj.Hash() - if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { - return false - } - - // Handle GasWanted field - toEvalGasWanted := toIntPtr(obj.GasWanted()) - if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { - return false - } - - // Handle GasUsed field - toEvalGasUsed := toIntPtr(obj.GasUsed()) - if f.GasUsed != nil && !f.GasUsed.Eval(toEvalGasUsed) { - return false - } - - // Handle GasFee field - toEvalGasFee := obj.GasFee() - if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { - return false - } - - // Handle BlockHeight field - toEvalBlockHeight := toIntPtr(obj.BlockHeight()) - if f.BlockHeight != nil && !f.BlockHeight.Eval(toEvalBlockHeight) { - return false - } - - return true -} - -// MinMax function for Index -func (f *FilterTransaction) MinMaxIndex() (min *int, max *int) { - // Recursively handle And conditions - if len(f.And) > 0 { - for _, subFilter := range f.And { - subMin, subMax := subFilter.MinMaxIndex() - if subMin != nil && (min == nil || *subMin < *min) { - min = subMin - } - if subMax != nil && (max == nil || *subMax > *max) { - max = subMax - } - } - } - - // Recursively handle Or conditions - if len(f.Or) > 0 { - for _, subFilter := range f.Or { - subMin, subMax := subFilter.MinMaxIndex() - if subMin != nil && (min == nil || *subMin < *min) { - min = subMin - } - if subMax != nil && (max == nil || *subMax > *max) { - max = subMax - } - } - } - - if f.Index != nil { - if f.Index.Gt != nil { - if min == nil || *f.Index.Gt < *min { - min = f.Index.Gt - } - if max == nil || *f.Index.Gt > *max { - max = f.Index.Gt - } - } - - if f.Index.Lt != nil { - if min == nil || *f.Index.Lt < *min { - min = f.Index.Lt - } - if max == nil || *f.Index.Lt > *max { - max = f.Index.Lt - } - } - - if f.Index.Eq != nil { - if min == nil || *f.Index.Eq < *min { - min = f.Index.Eq - } - if max == nil || *f.Index.Eq > *max { - max = f.Index.Eq - } - } - } - - return min, max -} - -// MinMax function for BlockHeight -func (f *FilterTransaction) MinMaxBlockHeight() (min *int, max *int) { - // Recursively handle And conditions - if len(f.And) > 0 { - for _, subFilter := range f.And { - subMin, subMax := subFilter.MinMaxBlockHeight() - if subMin != nil && (min == nil || *subMin < *min) { - min = subMin - } - if subMax != nil && (max == nil || *subMax > *max) { - max = subMax - } - } - } - - // Recursively handle Or conditions - if len(f.Or) > 0 { - for _, subFilter := range f.Or { - subMin, subMax := subFilter.MinMaxBlockHeight() - if subMin != nil && (min == nil || *subMin < *min) { - min = subMin - } - if subMax != nil && (max == nil || *subMax > *max) { - max = subMax - } - } - } - - if f.BlockHeight != nil { - if f.BlockHeight.Gt != nil { - if min == nil || *f.BlockHeight.Gt < *min { - min = f.BlockHeight.Gt - } - if max == nil || *f.BlockHeight.Gt > *max { - max = f.BlockHeight.Gt - } - } - - if f.BlockHeight.Lt != nil { - if min == nil || *f.BlockHeight.Lt < *min { - min = f.BlockHeight.Lt - } - if max == nil || *f.BlockHeight.Lt > *max { - max = f.BlockHeight.Lt - } - } - - if f.BlockHeight.Eq != nil { - if min == nil || *f.BlockHeight.Eq < *min { - min = f.BlockHeight.Eq - } - if max == nil || *f.BlockHeight.Eq > *max { - max = f.BlockHeight.Eq - } - } - } - - return min, max -} - -func (f *FilterCoin) Eval(obj *Coin) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Denom field - toEvalDenom := obj.Denom - if f.Denom != nil && !f.Denom.Eval(&toEvalDenom) { - return false - } - - // Handle Amount field - toEvalAmount := toIntPtr(obj.Amount) - if f.Amount != nil && !f.Amount.Eval(toEvalAmount) { - return false - } - - return true -} - -func (f *FilterBlockTransaction) Eval(obj *BlockTransaction) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Memo field - toEvalMemo := obj.Memo - if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { - return false - } - - // Handle Hash field - toEvalHash := obj.Hash - if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { - return false - } - - // Handle Fee field - toEvalFee := obj.Fee - if f.Fee != nil && !f.Fee.Eval(toEvalFee) { - return false - } - - return true -} - -func (f *FilterBlock) Eval(obj *Block) bool { - // Evaluate logical operators first - if len(f.And) > 0 { - for _, subFilter := range f.And { - if !subFilter.Eval(obj) { - return false - } - } - } - - if len(f.Or) > 0 { - orResult := false - for _, subFilter := range f.Or { - if subFilter.Eval(obj) { - orResult = true - break - } - } - if !orResult { - return false - } - } - - if f.Not != nil { - if f.Not.Eval(obj) { - return false - } - } - - // Evaluate individual field filters - - // Handle Version field - toEvalVersion := obj.Version() - if f.Version != nil && !f.Version.Eval(&toEvalVersion) { - return false - } - - // Handle ValidatorsHash field - toEvalValidatorsHash := obj.ValidatorsHash() - if f.ValidatorsHash != nil && !f.ValidatorsHash.Eval(&toEvalValidatorsHash) { - return false - } - - // Handle Txs slice - if f.Txs != nil { - for _, elem := range obj.Txs() { - if !f.Txs.Eval(elem) { - return false - } - } - } - - // Handle TotalTxs field - toEvalTotalTxs := toIntPtr(obj.TotalTxs()) - if f.TotalTxs != nil && !f.TotalTxs.Eval(toEvalTotalTxs) { - return false - } - - // Handle Time field - toEvalTime := obj.Time() - if f.Time != nil && !f.Time.Eval(&toEvalTime) { - return false - } - - // Handle ProposerAddressRaw field - toEvalProposerAddressRaw := obj.ProposerAddressRaw() - if f.ProposerAddressRaw != nil && !f.ProposerAddressRaw.Eval(&toEvalProposerAddressRaw) { - return false - } - - // Handle NumTxs field - toEvalNumTxs := toIntPtr(obj.NumTxs()) - if f.NumTxs != nil && !f.NumTxs.Eval(toEvalNumTxs) { - return false - } - - // Handle NextValidatorsHash field - toEvalNextValidatorsHash := obj.NextValidatorsHash() - if f.NextValidatorsHash != nil && !f.NextValidatorsHash.Eval(&toEvalNextValidatorsHash) { - return false - } - - // Handle LastResultsHash field - toEvalLastResultsHash := obj.LastResultsHash() - if f.LastResultsHash != nil && !f.LastResultsHash.Eval(&toEvalLastResultsHash) { - return false - } - - // Handle LastCommitHash field - toEvalLastCommitHash := obj.LastCommitHash() - if f.LastCommitHash != nil && !f.LastCommitHash.Eval(&toEvalLastCommitHash) { - return false - } - - // Handle LastBlockHash field - toEvalLastBlockHash := obj.LastBlockHash() - if f.LastBlockHash != nil && !f.LastBlockHash.Eval(&toEvalLastBlockHash) { - return false - } - - // Handle Height field - toEvalHeight := toIntPtr(obj.Height()) - if f.Height != nil && !f.Height.Eval(toEvalHeight) { - return false - } - - // Handle Hash field - toEvalHash := obj.Hash() - if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { - return false - } - - // Handle ConsensusHash field - toEvalConsensusHash := obj.ConsensusHash() - if f.ConsensusHash != nil && !f.ConsensusHash.Eval(&toEvalConsensusHash) { - return false - } - - // Handle ChainID field - toEvalChainID := obj.ChainID() - if f.ChainID != nil && !f.ChainID.Eval(&toEvalChainID) { - return false - } - - // Handle AppVersion field - toEvalAppVersion := obj.AppVersion() - if f.AppVersion != nil && !f.AppVersion.Eval(&toEvalAppVersion) { - return false - } - - // Handle AppHash field - toEvalAppHash := obj.AppHash() - if f.AppHash != nil && !f.AppHash.Eval(&toEvalAppHash) { - return false - } - - return true -} - -// MinMax function for Height -func (f *FilterBlock) MinMaxHeight() (min *int, max *int) { - // Recursively handle And conditions - if len(f.And) > 0 { - for _, subFilter := range f.And { - subMin, subMax := subFilter.MinMaxHeight() - if subMin != nil && (min == nil || *subMin < *min) { - min = subMin - } - if subMax != nil && (max == nil || *subMax > *max) { - max = subMax - } - } - } - - // Recursively handle Or conditions - if len(f.Or) > 0 { - for _, subFilter := range f.Or { - subMin, subMax := subFilter.MinMaxHeight() - if subMin != nil && (min == nil || *subMin < *min) { - min = subMin - } - if subMax != nil && (max == nil || *subMax > *max) { - max = subMax - } - } - } - - if f.Height != nil { - if f.Height.Gt != nil { - if min == nil || *f.Height.Gt < *min { - min = f.Height.Gt - } - if max == nil || *f.Height.Gt > *max { - max = f.Height.Gt - } - } - - if f.Height.Lt != nil { - if min == nil || *f.Height.Lt < *min { - min = f.Height.Lt - } - if max == nil || *f.Height.Lt > *max { - max = f.Height.Lt - } - } - - if f.Height.Eq != nil { - if min == nil || *f.Height.Eq < *min { - min = f.Height.Eq - } - if max == nil || *f.Height.Eq > *max { - max = f.Height.Eq - } - } - } - - return min, max -} - -func toIntPtr(val interface{}) *int { - if val == nil { - return nil - } - - switch v := val.(type) { - case int: - return &v - case int64: - i := int(v) - return &i - case int32: - i := int(v) - return &i - case int16: - i := int(v) - return &i - case int8: - i := int(v) - return &i - case *int: - return v - case *int64: - i := int(*v) - return &i - case *int32: - i := int(*v) - return &i - case *int16: - i := int(*v) - return &i - case *int8: - i := int(*v) - return &i - default: - return nil - } -} - -///////////////////////////////// GENERIC TYPES ///////////////////////////////// - -func (f *FilterBoolean) Eval(val *bool) bool { - if f == nil { - return true - } - - return rootEval(val, f.Exists, f.Eq, nil) -} - -func (f *FilterNumber) Eval(val *int) bool { - if f == nil { - return true - } - - if !rootEval(val, f.Exists, f.Eq, f.Neq) { - return false - } - - if val != nil && f.Gt != nil && *val <= *f.Gt { - return false - } - - if val != nil && f.Lt != nil && *val >= *f.Lt { - return false - } - - return true -} - -func (f *FilterString) Eval(val *string) bool { - if f == nil { - return true - } - - if !rootEval(val, f.Exists, f.Eq, f.Neq) { - return false - } - - if val != nil && f.Like != nil { - matched, err := regexp.MatchString(*f.Like, *val) - if err != nil || !matched { - return false - } - } - - if val != nil && f.Nlike != nil { - matched, err := regexp.MatchString(*f.Nlike, *val) - if err != nil || matched { - return false - } - } - - return true -} - -// Eval evaluates the FilterTime conditions against a given time.Time value -func (f *FilterTime) Eval(val *time.Time) bool { - if f == nil { - return true - } - - if !rootEval(val, f.Exists, f.Eq, f.Neq) { - return false - } - - // Check if the value is before the specified time - if f.Before != nil && !val.Before(*f.Before) { - return false - } - - // Check if the value is after the specified time - if f.After != nil && !val.After(*f.After) { - return false - } - - return true -} - -// rootEval is a generic function that checks if the provided value matches the filter conditions. -func rootEval[T comparable](val *T, exists *bool, eq *T, neq *T) bool { - // Check the Exists filter - if exists != nil { - if *exists && val == nil { - return false - } - if !*exists && val != nil { - return false - } - } - - // If val is nil and we reach this point, skip the following checks - if val == nil { - return true - } - - // Check the Eq filter - if eq != nil && *eq != *val { - return false - } - - // Check the Neq filter - if neq != nil && *neq == *val { - return false - } - - return true -} diff --git a/serve/graph/model/filter_methods_gen.go b/serve/graph/model/filter_methods_gen.go new file mode 100644 index 00000000..4d586c92 --- /dev/null +++ b/serve/graph/model/filter_methods_gen.go @@ -0,0 +1,2286 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +import ( + "regexp" + "time" +) + +///////////////////////////////// CUSTOM TYPES ///////////////////////////////// + +func (f *NestedFilterUnknownEvent) Eval(obj *UnknownEvent) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Value field + toEvalValue := obj.Value + if f.Value != nil && !f.Value.Eval(&toEvalValue) { + return false + } + + return true +} + +func (f *NestedFilterTxFee) Eval(obj *TxFee) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle GasWanted field + toEvalGasWanted := toIntPtr(obj.GasWanted) + if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { + return false + } + + // Handle GasFee field + toEvalGasFee := obj.GasFee + if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { + return false + } + + return true +} + +func (f *NestedFilterTransactionResponse) Eval(obj *TransactionResponse) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Log field + toEvalLog := obj.Log() + if f.Log != nil && !f.Log.Eval(&toEvalLog) { + return false + } + + // Handle Info field + toEvalInfo := obj.Info() + if f.Info != nil && !f.Info.Eval(&toEvalInfo) { + return false + } + + // Handle Events slice + if f.Events != nil { + for _, elem := range obj.Events() { + if !f.Events.Eval(&elem) { + return false + } + } + } + + // Handle Error field + toEvalError := obj.Error() + if f.Error != nil && !f.Error.Eval(&toEvalError) { + return false + } + + // Handle Data field + toEvalData := obj.Data() + if f.Data != nil && !f.Data.Eval(&toEvalData) { + return false + } + + return true +} + +func (f *NestedFilterTransactionMessage) Eval(obj *TransactionMessage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Value field + toEvalValue := obj.Value + if f.Value != nil && !f.Value.Eval(&toEvalValue) { + return false + } + + // Handle TypeURL field + toEvalTypeURL := obj.TypeURL + if f.TypeURL != nil && !f.TypeURL.Eval(&toEvalTypeURL) { + return false + } + + // Handle Route field + toEvalRoute := obj.Route + if f.Route != nil && !f.Route.Eval(&toEvalRoute) { + return false + } + + return true +} + +func (f *NestedFilterMsgRun) Eval(obj *MsgRun) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Send field + toEvalSend := obj.Send + if f.Send != nil && !f.Send.Eval(&toEvalSend) { + return false + } + + // Handle Package field + toEvalPackage := obj.Package + if f.Package != nil && !f.Package.Eval(toEvalPackage) { + return false + } + + // Handle Caller field + toEvalCaller := obj.Caller + if f.Caller != nil && !f.Caller.Eval(&toEvalCaller) { + return false + } + + return true +} + +func (f *NestedFilterMsgCall) Eval(obj *MsgCall) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Send field + toEvalSend := obj.Send + if f.Send != nil && !f.Send.Eval(&toEvalSend) { + return false + } + + // Handle PkgPath field + toEvalPkgPath := obj.PkgPath + if f.PkgPath != nil && !f.PkgPath.Eval(&toEvalPkgPath) { + return false + } + + // Handle Func field + toEvalFunc := obj.Func + if f.Func != nil && !f.Func.Eval(&toEvalFunc) { + return false + } + + // Handle Caller field + toEvalCaller := obj.Caller + if f.Caller != nil && !f.Caller.Eval(&toEvalCaller) { + return false + } + + // Handle Args slice + if f.Args != nil { + for _, elem := range obj.Args { + if !f.Args.Eval(&elem) { + return false + } + } + } + + return true +} + +func (f *NestedFilterMsgAddPackage) Eval(obj *MsgAddPackage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Package field + toEvalPackage := obj.Package + if f.Package != nil && !f.Package.Eval(toEvalPackage) { + return false + } + + // Handle Deposit field + toEvalDeposit := obj.Deposit + if f.Deposit != nil && !f.Deposit.Eval(&toEvalDeposit) { + return false + } + + // Handle Creator field + toEvalCreator := obj.Creator + if f.Creator != nil && !f.Creator.Eval(&toEvalCreator) { + return false + } + + return true +} + +func (f *NestedFilterMessageValue) Eval(obj *MessageValue) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Handle union objects depending of the type + tobj := *obj + switch objv := tobj.(type) { + case BankMsgSend: + + // Handle BankMsgSend field + toEvalBankMsgSend := objv + if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&toEvalBankMsgSend) { + return false + } + + case MsgCall: + + // Handle MsgCall field + toEvalMsgCall := objv + if f.MsgCall != nil && !f.MsgCall.Eval(&toEvalMsgCall) { + return false + } + + case MsgAddPackage: + + // Handle MsgAddPackage field + toEvalMsgAddPackage := objv + if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&toEvalMsgAddPackage) { + return false + } + + case MsgRun: + + // Handle MsgRun field + toEvalMsgRun := objv + if f.MsgRun != nil && !f.MsgRun.Eval(&toEvalMsgRun) { + return false + } + + } + + return true +} + +func (f *NestedFilterMemPackage) Eval(obj *MemPackage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Path field + toEvalPath := obj.Path + if f.Path != nil && !f.Path.Eval(&toEvalPath) { + return false + } + + // Handle Name field + toEvalName := obj.Name + if f.Name != nil && !f.Name.Eval(&toEvalName) { + return false + } + + // Handle Files slice + if f.Files != nil { + for _, elem := range obj.Files { + if !f.Files.Eval(elem) { + return false + } + } + } + + return true +} + +func (f *NestedFilterMemFile) Eval(obj *MemFile) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Name field + toEvalName := obj.Name + if f.Name != nil && !f.Name.Eval(&toEvalName) { + return false + } + + // Handle Body field + toEvalBody := obj.Body + if f.Body != nil && !f.Body.Eval(&toEvalBody) { + return false + } + + return true +} + +func (f *NestedFilterGnoEventAttribute) Eval(obj *GnoEventAttribute) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Value field + toEvalValue := obj.Value + if f.Value != nil && !f.Value.Eval(&toEvalValue) { + return false + } + + // Handle Key field + toEvalKey := obj.Key + if f.Key != nil && !f.Key.Eval(&toEvalKey) { + return false + } + + return true +} + +func (f *NestedFilterGnoEvent) Eval(obj *GnoEvent) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Type field + toEvalType := obj.Type + if f.Type != nil && !f.Type.Eval(&toEvalType) { + return false + } + + // Handle PkgPath field + toEvalPkgPath := obj.PkgPath + if f.PkgPath != nil && !f.PkgPath.Eval(&toEvalPkgPath) { + return false + } + + // Handle Func field + toEvalFunc := obj.Func + if f.Func != nil && !f.Func.Eval(&toEvalFunc) { + return false + } + + // Handle Attrs slice + if f.Attrs != nil { + for _, elem := range obj.Attrs { + if !f.Attrs.Eval(elem) { + return false + } + } + } + + return true +} + +func (f *NestedFilterEvent) Eval(obj *Event) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Handle union objects depending of the type + tobj := *obj + switch objv := tobj.(type) { + case GnoEvent: + + // Handle GnoEvent field + toEvalGnoEvent := objv + if f.GnoEvent != nil && !f.GnoEvent.Eval(&toEvalGnoEvent) { + return false + } + + case UnknownEvent: + + // Handle UnknownEvent field + toEvalUnknownEvent := objv + if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&toEvalUnknownEvent) { + return false + } + + } + + return true +} + +func (f *NestedFilterCoin) Eval(obj *Coin) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Denom field + toEvalDenom := obj.Denom + if f.Denom != nil && !f.Denom.Eval(&toEvalDenom) { + return false + } + + // Handle Amount field + toEvalAmount := toIntPtr(obj.Amount) + if f.Amount != nil && !f.Amount.Eval(toEvalAmount) { + return false + } + + return true +} + +func (f *NestedFilterBlockTransaction) Eval(obj *BlockTransaction) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Memo field + toEvalMemo := obj.Memo + if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle Fee field + toEvalFee := obj.Fee + if f.Fee != nil && !f.Fee.Eval(toEvalFee) { + return false + } + + return true +} + +func (f *NestedFilterBankMsgSend) Eval(obj *BankMsgSend) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle ToAddress field + toEvalToAddress := obj.ToAddress + if f.ToAddress != nil && !f.ToAddress.Eval(&toEvalToAddress) { + return false + } + + // Handle FromAddress field + toEvalFromAddress := obj.FromAddress + if f.FromAddress != nil && !f.FromAddress.Eval(&toEvalFromAddress) { + return false + } + + // Handle Amount field + toEvalAmount := obj.Amount + if f.Amount != nil && !f.Amount.Eval(&toEvalAmount) { + return false + } + + return true +} + +func (f *FilterUnknownEvent) Eval(obj *UnknownEvent) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Value field + toEvalValue := obj.Value + if f.Value != nil && !f.Value.Eval(&toEvalValue) { + return false + } + + return true +} + +func (f *FilterTxFee) Eval(obj *TxFee) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle GasWanted field + toEvalGasWanted := toIntPtr(obj.GasWanted) + if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { + return false + } + + // Handle GasFee field + toEvalGasFee := obj.GasFee + if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { + return false + } + + return true +} + +func (f *FilterTransactionResponse) Eval(obj *TransactionResponse) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Log field + toEvalLog := obj.Log() + if f.Log != nil && !f.Log.Eval(&toEvalLog) { + return false + } + + // Handle Info field + toEvalInfo := obj.Info() + if f.Info != nil && !f.Info.Eval(&toEvalInfo) { + return false + } + + // Handle Events slice + if f.Events != nil { + for _, elem := range obj.Events() { + if !f.Events.Eval(&elem) { + return false + } + } + } + + // Handle Error field + toEvalError := obj.Error() + if f.Error != nil && !f.Error.Eval(&toEvalError) { + return false + } + + // Handle Data field + toEvalData := obj.Data() + if f.Data != nil && !f.Data.Eval(&toEvalData) { + return false + } + + return true +} + +func (f *FilterTransactionMessage) Eval(obj *TransactionMessage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Value field + toEvalValue := obj.Value + if f.Value != nil && !f.Value.Eval(&toEvalValue) { + return false + } + + // Handle TypeURL field + toEvalTypeURL := obj.TypeURL + if f.TypeURL != nil && !f.TypeURL.Eval(&toEvalTypeURL) { + return false + } + + // Handle Route field + toEvalRoute := obj.Route + if f.Route != nil && !f.Route.Eval(&toEvalRoute) { + return false + } + + return true +} + +func (f *FilterTransaction) Eval(obj *Transaction) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Success field + toEvalSuccess := obj.Success() + if f.Success != nil && !f.Success.Eval(&toEvalSuccess) { + return false + } + + // Handle Response field + toEvalResponse := obj.Response() + if f.Response != nil && !f.Response.Eval(toEvalResponse) { + return false + } + + // Handle Messages slice + if f.Messages != nil { + for _, elem := range obj.Messages() { + if !f.Messages.Eval(elem) { + return false + } + } + } + + // Handle Memo field + toEvalMemo := obj.Memo() + if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { + return false + } + + // Handle Index field + toEvalIndex := toIntPtr(obj.Index()) + if f.Index != nil && !f.Index.Eval(toEvalIndex) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash() + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle GasWanted field + toEvalGasWanted := toIntPtr(obj.GasWanted()) + if f.GasWanted != nil && !f.GasWanted.Eval(toEvalGasWanted) { + return false + } + + // Handle GasUsed field + toEvalGasUsed := toIntPtr(obj.GasUsed()) + if f.GasUsed != nil && !f.GasUsed.Eval(toEvalGasUsed) { + return false + } + + // Handle GasFee field + toEvalGasFee := obj.GasFee() + if f.GasFee != nil && !f.GasFee.Eval(toEvalGasFee) { + return false + } + + // Handle BlockHeight field + toEvalBlockHeight := toIntPtr(obj.BlockHeight()) + if f.BlockHeight != nil && !f.BlockHeight.Eval(toEvalBlockHeight) { + return false + } + + return true +} + +// MinMax function for Index +func (f *FilterTransaction) MinMaxIndex() (min *int, max *int) { + // Recursively handle And conditions + if len(f.And) > 0 { + for _, subFilter := range f.And { + subMin, subMax := subFilter.MinMaxIndex() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + // Recursively handle Or conditions + if len(f.Or) > 0 { + for _, subFilter := range f.Or { + subMin, subMax := subFilter.MinMaxIndex() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + if f.Index != nil { + if f.Index.Gt != nil { + if min == nil || *f.Index.Gt < *min { + min = f.Index.Gt + } + if max == nil || *f.Index.Gt > *max { + max = f.Index.Gt + } + } + + if f.Index.Lt != nil { + if min == nil || *f.Index.Lt < *min { + min = f.Index.Lt + } + if max == nil || *f.Index.Lt > *max { + max = f.Index.Lt + } + } + + if f.Index.Eq != nil { + if min == nil || *f.Index.Eq < *min { + min = f.Index.Eq + } + if max == nil || *f.Index.Eq > *max { + max = f.Index.Eq + } + } + } + + return min, max +} + +// MinMax function for BlockHeight +func (f *FilterTransaction) MinMaxBlockHeight() (min *int, max *int) { + // Recursively handle And conditions + if len(f.And) > 0 { + for _, subFilter := range f.And { + subMin, subMax := subFilter.MinMaxBlockHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + // Recursively handle Or conditions + if len(f.Or) > 0 { + for _, subFilter := range f.Or { + subMin, subMax := subFilter.MinMaxBlockHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + if f.BlockHeight != nil { + if f.BlockHeight.Gt != nil { + if min == nil || *f.BlockHeight.Gt < *min { + min = f.BlockHeight.Gt + } + if max == nil || *f.BlockHeight.Gt > *max { + max = f.BlockHeight.Gt + } + } + + if f.BlockHeight.Lt != nil { + if min == nil || *f.BlockHeight.Lt < *min { + min = f.BlockHeight.Lt + } + if max == nil || *f.BlockHeight.Lt > *max { + max = f.BlockHeight.Lt + } + } + + if f.BlockHeight.Eq != nil { + if min == nil || *f.BlockHeight.Eq < *min { + min = f.BlockHeight.Eq + } + if max == nil || *f.BlockHeight.Eq > *max { + max = f.BlockHeight.Eq + } + } + } + + return min, max +} + +func (f *FilterMsgRun) Eval(obj *MsgRun) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Send field + toEvalSend := obj.Send + if f.Send != nil && !f.Send.Eval(&toEvalSend) { + return false + } + + // Handle Package field + toEvalPackage := obj.Package + if f.Package != nil && !f.Package.Eval(toEvalPackage) { + return false + } + + // Handle Caller field + toEvalCaller := obj.Caller + if f.Caller != nil && !f.Caller.Eval(&toEvalCaller) { + return false + } + + return true +} + +func (f *FilterMsgCall) Eval(obj *MsgCall) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Send field + toEvalSend := obj.Send + if f.Send != nil && !f.Send.Eval(&toEvalSend) { + return false + } + + // Handle PkgPath field + toEvalPkgPath := obj.PkgPath + if f.PkgPath != nil && !f.PkgPath.Eval(&toEvalPkgPath) { + return false + } + + // Handle Func field + toEvalFunc := obj.Func + if f.Func != nil && !f.Func.Eval(&toEvalFunc) { + return false + } + + // Handle Caller field + toEvalCaller := obj.Caller + if f.Caller != nil && !f.Caller.Eval(&toEvalCaller) { + return false + } + + // Handle Args slice + if f.Args != nil { + for _, elem := range obj.Args { + if !f.Args.Eval(&elem) { + return false + } + } + } + + return true +} + +func (f *FilterMsgAddPackage) Eval(obj *MsgAddPackage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Package field + toEvalPackage := obj.Package + if f.Package != nil && !f.Package.Eval(toEvalPackage) { + return false + } + + // Handle Deposit field + toEvalDeposit := obj.Deposit + if f.Deposit != nil && !f.Deposit.Eval(&toEvalDeposit) { + return false + } + + // Handle Creator field + toEvalCreator := obj.Creator + if f.Creator != nil && !f.Creator.Eval(&toEvalCreator) { + return false + } + + return true +} + +func (f *FilterMessageValue) Eval(obj *MessageValue) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Handle union objects depending of the type + tobj := *obj + switch objv := tobj.(type) { + case BankMsgSend: + + // Handle BankMsgSend field + toEvalBankMsgSend := objv + if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&toEvalBankMsgSend) { + return false + } + + case MsgCall: + + // Handle MsgCall field + toEvalMsgCall := objv + if f.MsgCall != nil && !f.MsgCall.Eval(&toEvalMsgCall) { + return false + } + + case MsgAddPackage: + + // Handle MsgAddPackage field + toEvalMsgAddPackage := objv + if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&toEvalMsgAddPackage) { + return false + } + + case MsgRun: + + // Handle MsgRun field + toEvalMsgRun := objv + if f.MsgRun != nil && !f.MsgRun.Eval(&toEvalMsgRun) { + return false + } + + } + + return true +} + +func (f *FilterMemPackage) Eval(obj *MemPackage) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Path field + toEvalPath := obj.Path + if f.Path != nil && !f.Path.Eval(&toEvalPath) { + return false + } + + // Handle Name field + toEvalName := obj.Name + if f.Name != nil && !f.Name.Eval(&toEvalName) { + return false + } + + // Handle Files slice + if f.Files != nil { + for _, elem := range obj.Files { + if !f.Files.Eval(elem) { + return false + } + } + } + + return true +} + +func (f *FilterMemFile) Eval(obj *MemFile) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Name field + toEvalName := obj.Name + if f.Name != nil && !f.Name.Eval(&toEvalName) { + return false + } + + // Handle Body field + toEvalBody := obj.Body + if f.Body != nil && !f.Body.Eval(&toEvalBody) { + return false + } + + return true +} + +func (f *FilterGnoEventAttribute) Eval(obj *GnoEventAttribute) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Value field + toEvalValue := obj.Value + if f.Value != nil && !f.Value.Eval(&toEvalValue) { + return false + } + + // Handle Key field + toEvalKey := obj.Key + if f.Key != nil && !f.Key.Eval(&toEvalKey) { + return false + } + + return true +} + +func (f *FilterGnoEvent) Eval(obj *GnoEvent) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Type field + toEvalType := obj.Type + if f.Type != nil && !f.Type.Eval(&toEvalType) { + return false + } + + // Handle PkgPath field + toEvalPkgPath := obj.PkgPath + if f.PkgPath != nil && !f.PkgPath.Eval(&toEvalPkgPath) { + return false + } + + // Handle Func field + toEvalFunc := obj.Func + if f.Func != nil && !f.Func.Eval(&toEvalFunc) { + return false + } + + // Handle Attrs slice + if f.Attrs != nil { + for _, elem := range obj.Attrs { + if !f.Attrs.Eval(elem) { + return false + } + } + } + + return true +} + +func (f *FilterEvent) Eval(obj *Event) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Handle union objects depending of the type + tobj := *obj + switch objv := tobj.(type) { + case GnoEvent: + + // Handle GnoEvent field + toEvalGnoEvent := objv + if f.GnoEvent != nil && !f.GnoEvent.Eval(&toEvalGnoEvent) { + return false + } + + case UnknownEvent: + + // Handle UnknownEvent field + toEvalUnknownEvent := objv + if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&toEvalUnknownEvent) { + return false + } + + } + + return true +} + +func (f *FilterCoin) Eval(obj *Coin) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Denom field + toEvalDenom := obj.Denom + if f.Denom != nil && !f.Denom.Eval(&toEvalDenom) { + return false + } + + // Handle Amount field + toEvalAmount := toIntPtr(obj.Amount) + if f.Amount != nil && !f.Amount.Eval(toEvalAmount) { + return false + } + + return true +} + +func (f *FilterBlockTransaction) Eval(obj *BlockTransaction) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Memo field + toEvalMemo := obj.Memo + if f.Memo != nil && !f.Memo.Eval(&toEvalMemo) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle Fee field + toEvalFee := obj.Fee + if f.Fee != nil && !f.Fee.Eval(toEvalFee) { + return false + } + + return true +} + +func (f *FilterBlock) Eval(obj *Block) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle Version field + toEvalVersion := obj.Version() + if f.Version != nil && !f.Version.Eval(&toEvalVersion) { + return false + } + + // Handle ValidatorsHash field + toEvalValidatorsHash := obj.ValidatorsHash() + if f.ValidatorsHash != nil && !f.ValidatorsHash.Eval(&toEvalValidatorsHash) { + return false + } + + // Handle Txs slice + if f.Txs != nil { + for _, elem := range obj.Txs() { + if !f.Txs.Eval(elem) { + return false + } + } + } + + // Handle TotalTxs field + toEvalTotalTxs := toIntPtr(obj.TotalTxs()) + if f.TotalTxs != nil && !f.TotalTxs.Eval(toEvalTotalTxs) { + return false + } + + // Handle Time field + toEvalTime := obj.Time() + if f.Time != nil && !f.Time.Eval(&toEvalTime) { + return false + } + + // Handle ProposerAddressRaw field + toEvalProposerAddressRaw := obj.ProposerAddressRaw() + if f.ProposerAddressRaw != nil && !f.ProposerAddressRaw.Eval(&toEvalProposerAddressRaw) { + return false + } + + // Handle NumTxs field + toEvalNumTxs := toIntPtr(obj.NumTxs()) + if f.NumTxs != nil && !f.NumTxs.Eval(toEvalNumTxs) { + return false + } + + // Handle NextValidatorsHash field + toEvalNextValidatorsHash := obj.NextValidatorsHash() + if f.NextValidatorsHash != nil && !f.NextValidatorsHash.Eval(&toEvalNextValidatorsHash) { + return false + } + + // Handle LastResultsHash field + toEvalLastResultsHash := obj.LastResultsHash() + if f.LastResultsHash != nil && !f.LastResultsHash.Eval(&toEvalLastResultsHash) { + return false + } + + // Handle LastCommitHash field + toEvalLastCommitHash := obj.LastCommitHash() + if f.LastCommitHash != nil && !f.LastCommitHash.Eval(&toEvalLastCommitHash) { + return false + } + + // Handle LastBlockHash field + toEvalLastBlockHash := obj.LastBlockHash() + if f.LastBlockHash != nil && !f.LastBlockHash.Eval(&toEvalLastBlockHash) { + return false + } + + // Handle Height field + toEvalHeight := toIntPtr(obj.Height()) + if f.Height != nil && !f.Height.Eval(toEvalHeight) { + return false + } + + // Handle Hash field + toEvalHash := obj.Hash() + if f.Hash != nil && !f.Hash.Eval(&toEvalHash) { + return false + } + + // Handle ConsensusHash field + toEvalConsensusHash := obj.ConsensusHash() + if f.ConsensusHash != nil && !f.ConsensusHash.Eval(&toEvalConsensusHash) { + return false + } + + // Handle ChainID field + toEvalChainID := obj.ChainID() + if f.ChainID != nil && !f.ChainID.Eval(&toEvalChainID) { + return false + } + + // Handle AppVersion field + toEvalAppVersion := obj.AppVersion() + if f.AppVersion != nil && !f.AppVersion.Eval(&toEvalAppVersion) { + return false + } + + // Handle AppHash field + toEvalAppHash := obj.AppHash() + if f.AppHash != nil && !f.AppHash.Eval(&toEvalAppHash) { + return false + } + + return true +} + +// MinMax function for Height +func (f *FilterBlock) MinMaxHeight() (min *int, max *int) { + // Recursively handle And conditions + if len(f.And) > 0 { + for _, subFilter := range f.And { + subMin, subMax := subFilter.MinMaxHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + // Recursively handle Or conditions + if len(f.Or) > 0 { + for _, subFilter := range f.Or { + subMin, subMax := subFilter.MinMaxHeight() + if subMin != nil && (min == nil || *subMin < *min) { + min = subMin + } + if subMax != nil && (max == nil || *subMax > *max) { + max = subMax + } + } + } + + if f.Height != nil { + if f.Height.Gt != nil { + if min == nil || *f.Height.Gt < *min { + min = f.Height.Gt + } + if max == nil || *f.Height.Gt > *max { + max = f.Height.Gt + } + } + + if f.Height.Lt != nil { + if min == nil || *f.Height.Lt < *min { + min = f.Height.Lt + } + if max == nil || *f.Height.Lt > *max { + max = f.Height.Lt + } + } + + if f.Height.Eq != nil { + if min == nil || *f.Height.Eq < *min { + min = f.Height.Eq + } + if max == nil || *f.Height.Eq > *max { + max = f.Height.Eq + } + } + } + + return min, max +} + +func (f *FilterBankMsgSend) Eval(obj *BankMsgSend) bool { + // Evaluate logical operators first + if len(f.And) > 0 { + for _, subFilter := range f.And { + if !subFilter.Eval(obj) { + return false + } + } + } + + if len(f.Or) > 0 { + orResult := false + for _, subFilter := range f.Or { + if subFilter.Eval(obj) { + orResult = true + break + } + } + if !orResult { + return false + } + } + + if f.Not != nil { + if f.Not.Eval(obj) { + return false + } + } + + // Evaluate individual field filters + + // Handle ToAddress field + toEvalToAddress := obj.ToAddress + if f.ToAddress != nil && !f.ToAddress.Eval(&toEvalToAddress) { + return false + } + + // Handle FromAddress field + toEvalFromAddress := obj.FromAddress + if f.FromAddress != nil && !f.FromAddress.Eval(&toEvalFromAddress) { + return false + } + + // Handle Amount field + toEvalAmount := obj.Amount + if f.Amount != nil && !f.Amount.Eval(&toEvalAmount) { + return false + } + + return true +} + +func toIntPtr(val interface{}) *int { + if val == nil { + return nil + } + + switch v := val.(type) { + case int: + return &v + case int64: + i := int(v) + return &i + case int32: + i := int(v) + return &i + case int16: + i := int(v) + return &i + case int8: + i := int(v) + return &i + case *int: + return v + case *int64: + i := int(*v) + return &i + case *int32: + i := int(*v) + return &i + case *int16: + i := int(*v) + return &i + case *int8: + i := int(*v) + return &i + default: + return nil + } +} + +///////////////////////////////// GENERIC TYPES ///////////////////////////////// + +func (f *FilterBoolean) Eval(val *bool) bool { + if f == nil { + return true + } + + return rootEval(val, f.Exists, f.Eq, nil) +} + +func (f *FilterInt) Eval(val *int) bool { + if f == nil { + return true + } + + if !rootEval(val, f.Exists, f.Eq, f.Neq) { + return false + } + + if val != nil && f.Gt != nil && *val <= *f.Gt { + return false + } + + if val != nil && f.Lt != nil && *val >= *f.Lt { + return false + } + + return true +} + +func (f *FilterString) Eval(val *string) bool { + if f == nil { + return true + } + + if !rootEval(val, f.Exists, f.Eq, f.Neq) { + return false + } + + if val != nil && f.Like != nil { + matched, err := regexp.MatchString(*f.Like, *val) + if err != nil || !matched { + return false + } + } + + if val != nil && f.Nlike != nil { + matched, err := regexp.MatchString(*f.Nlike, *val) + if err != nil || matched { + return false + } + } + + return true +} + +// Eval evaluates the FilterTime conditions against a given time.Time value +func (f *FilterTime) Eval(val *time.Time) bool { + if f == nil { + return true + } + + if !rootEval(val, f.Exists, f.Eq, f.Neq) { + return false + } + + // Check if the value is before the specified time + if f.Before != nil && !val.Before(*f.Before) { + return false + } + + // Check if the value is after the specified time + if f.After != nil && !val.After(*f.After) { + return false + } + + return true +} + +// rootEval is a generic function that checks if the provided value matches the filter conditions. +func rootEval[T comparable](val *T, exists *bool, eq *T, neq *T) bool { + // Check the Exists filter + if exists != nil { + if *exists && val == nil { + return false + } + if !*exists && val != nil { + return false + } + } + + // If val is nil and we reach this point, skip the following checks + if val == nil { + return true + } + + // Check the Eq filter + if eq != nil && *eq != *val { + return false + } + + // Check the Neq filter + if neq != nil && *neq == *val { + return false + } + + return true +} diff --git a/serve/graph/model/models_gen.go b/serve/graph/model/models_gen.go index 8ee68b9b..568ba420 100644 --- a/serve/graph/model/models_gen.go +++ b/serve/graph/model/models_gen.go @@ -117,6 +117,22 @@ type EventInput struct { Attrs []*EventAttributeInput `json:"attrs,omitempty"` } +// filter for BankMsgSend objects +type FilterBankMsgSend struct { + // logical operator for BankMsgSend that will combine two or more conditions, returning true if all of them are true. + And []*FilterBankMsgSend `json:"_and,omitempty"` + // logical operator for BankMsgSend that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterBankMsgSend `json:"_or,omitempty"` + // logical operator for BankMsgSend that will reverse conditions. + Not *FilterBankMsgSend `json:"_not,omitempty"` + // filter for from_address field. + FromAddress *FilterString `json:"from_address,omitempty"` + // filter for to_address field. + ToAddress *FilterString `json:"to_address,omitempty"` + // filter for amount field. + Amount *FilterString `json:"amount,omitempty"` +} + // filter for Block objects type FilterBlock struct { // logical operator for Block that will combine two or more conditions, returning true if all of them are true. @@ -128,7 +144,7 @@ type FilterBlock struct { // filter for hash field. Hash *FilterString `json:"hash,omitempty"` // filter for height field. - Height *FilterNumber `json:"height,omitempty"` + Height *FilterInt `json:"height,omitempty"` // filter for version field. Version *FilterString `json:"version,omitempty"` // filter for chain_id field. @@ -136,9 +152,9 @@ type FilterBlock struct { // filter for time field. Time *FilterTime `json:"time,omitempty"` // filter for num_txs field. - NumTxs *FilterNumber `json:"num_txs,omitempty"` + NumTxs *FilterInt `json:"num_txs,omitempty"` // filter for total_txs field. - TotalTxs *FilterNumber `json:"total_txs,omitempty"` + TotalTxs *FilterInt `json:"total_txs,omitempty"` // filter for app_version field. AppVersion *FilterString `json:"app_version,omitempty"` // filter for last_block_hash field. @@ -194,13 +210,59 @@ type FilterCoin struct { // logical operator for Coin that will reverse conditions. Not *FilterCoin `json:"_not,omitempty"` // filter for amount field. - Amount *FilterNumber `json:"amount,omitempty"` + Amount *FilterInt `json:"amount,omitempty"` // filter for denom field. Denom *FilterString `json:"denom,omitempty"` } +// filter for Event objects +type FilterEvent struct { + // logical operator for Event that will combine two or more conditions, returning true if all of them are true. + And []*FilterEvent `json:"_and,omitempty"` + // logical operator for Event that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterEvent `json:"_or,omitempty"` + // logical operator for Event that will reverse conditions. + Not *FilterEvent `json:"_not,omitempty"` + // filter for GnoEvent union type. + GnoEvent *NestedFilterGnoEvent `json:"GnoEvent,omitempty"` + // filter for UnknownEvent union type. + UnknownEvent *NestedFilterUnknownEvent `json:"UnknownEvent,omitempty"` +} + +// filter for GnoEvent objects +type FilterGnoEvent struct { + // logical operator for GnoEvent that will combine two or more conditions, returning true if all of them are true. + And []*FilterGnoEvent `json:"_and,omitempty"` + // logical operator for GnoEvent that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterGnoEvent `json:"_or,omitempty"` + // logical operator for GnoEvent that will reverse conditions. + Not *FilterGnoEvent `json:"_not,omitempty"` + // filter for type field. + Type *FilterString `json:"type,omitempty"` + // filter for pkg_path field. + PkgPath *FilterString `json:"pkg_path,omitempty"` + // filter for func field. + Func *FilterString `json:"func,omitempty"` + // filter for attrs field. + Attrs *NestedFilterGnoEventAttribute `json:"attrs,omitempty"` +} + +// filter for GnoEventAttribute objects +type FilterGnoEventAttribute struct { + // logical operator for GnoEventAttribute that will combine two or more conditions, returning true if all of them are true. + And []*FilterGnoEventAttribute `json:"_and,omitempty"` + // logical operator for GnoEventAttribute that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterGnoEventAttribute `json:"_or,omitempty"` + // logical operator for GnoEventAttribute that will reverse conditions. + Not *FilterGnoEventAttribute `json:"_not,omitempty"` + // filter for key field. + Key *FilterString `json:"key,omitempty"` + // filter for value field. + Value *FilterString `json:"value,omitempty"` +} + // Filter type for number fields. All added filters here are processed as AND operators. -type FilterNumber struct { +type FilterInt struct { // Filter a number field checking if it exists or not. Exists *bool `json:"exists,omitempty"` // Filter a number field checking if it is equals to the specified value. @@ -213,6 +275,106 @@ type FilterNumber struct { Lt *int `json:"lt,omitempty"` } +// filter for MemFile objects +type FilterMemFile struct { + // logical operator for MemFile that will combine two or more conditions, returning true if all of them are true. + And []*FilterMemFile `json:"_and,omitempty"` + // logical operator for MemFile that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterMemFile `json:"_or,omitempty"` + // logical operator for MemFile that will reverse conditions. + Not *FilterMemFile `json:"_not,omitempty"` + // filter for name field. + Name *FilterString `json:"name,omitempty"` + // filter for body field. + Body *FilterString `json:"body,omitempty"` +} + +// filter for MemPackage objects +type FilterMemPackage struct { + // logical operator for MemPackage that will combine two or more conditions, returning true if all of them are true. + And []*FilterMemPackage `json:"_and,omitempty"` + // logical operator for MemPackage that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterMemPackage `json:"_or,omitempty"` + // logical operator for MemPackage that will reverse conditions. + Not *FilterMemPackage `json:"_not,omitempty"` + // filter for name field. + Name *FilterString `json:"name,omitempty"` + // filter for path field. + Path *FilterString `json:"path,omitempty"` + // filter for files field. + Files *NestedFilterMemFile `json:"files,omitempty"` +} + +// filter for MessageValue objects +type FilterMessageValue struct { + // logical operator for MessageValue that will combine two or more conditions, returning true if all of them are true. + And []*FilterMessageValue `json:"_and,omitempty"` + // logical operator for MessageValue that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterMessageValue `json:"_or,omitempty"` + // logical operator for MessageValue that will reverse conditions. + Not *FilterMessageValue `json:"_not,omitempty"` + // filter for BankMsgSend union type. + BankMsgSend *NestedFilterBankMsgSend `json:"BankMsgSend,omitempty"` + // filter for MsgCall union type. + MsgCall *NestedFilterMsgCall `json:"MsgCall,omitempty"` + // filter for MsgAddPackage union type. + MsgAddPackage *NestedFilterMsgAddPackage `json:"MsgAddPackage,omitempty"` + // filter for MsgRun union type. + MsgRun *NestedFilterMsgRun `json:"MsgRun,omitempty"` +} + +// filter for MsgAddPackage objects +type FilterMsgAddPackage struct { + // logical operator for MsgAddPackage that will combine two or more conditions, returning true if all of them are true. + And []*FilterMsgAddPackage `json:"_and,omitempty"` + // logical operator for MsgAddPackage that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterMsgAddPackage `json:"_or,omitempty"` + // logical operator for MsgAddPackage that will reverse conditions. + Not *FilterMsgAddPackage `json:"_not,omitempty"` + // filter for creator field. + Creator *FilterString `json:"creator,omitempty"` + // filter for package field. + Package *NestedFilterMemPackage `json:"package,omitempty"` + // filter for deposit field. + Deposit *FilterString `json:"deposit,omitempty"` +} + +// filter for MsgCall objects +type FilterMsgCall struct { + // logical operator for MsgCall that will combine two or more conditions, returning true if all of them are true. + And []*FilterMsgCall `json:"_and,omitempty"` + // logical operator for MsgCall that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterMsgCall `json:"_or,omitempty"` + // logical operator for MsgCall that will reverse conditions. + Not *FilterMsgCall `json:"_not,omitempty"` + // filter for caller field. + Caller *FilterString `json:"caller,omitempty"` + // filter for send field. + Send *FilterString `json:"send,omitempty"` + // filter for pkg_path field. + PkgPath *FilterString `json:"pkg_path,omitempty"` + // filter for func field. + Func *FilterString `json:"func,omitempty"` + // filter for args field. + Args *FilterString `json:"args,omitempty"` +} + +// filter for MsgRun objects +type FilterMsgRun struct { + // logical operator for MsgRun that will combine two or more conditions, returning true if all of them are true. + And []*FilterMsgRun `json:"_and,omitempty"` + // logical operator for MsgRun that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterMsgRun `json:"_or,omitempty"` + // logical operator for MsgRun that will reverse conditions. + Not *FilterMsgRun `json:"_not,omitempty"` + // filter for caller field. + Caller *FilterString `json:"caller,omitempty"` + // filter for send field. + Send *FilterString `json:"send,omitempty"` + // filter for package field. + Package *NestedFilterMemPackage `json:"package,omitempty"` +} + // Filter type for string fields. It contains a variety of filter types for string types. All added filters here are processed as AND operators. type FilterString struct { // Filter a string field checking if it exists or not. @@ -250,17 +412,17 @@ type FilterTransaction struct { // logical operator for Transaction that will reverse conditions. Not *FilterTransaction `json:"_not,omitempty"` // filter for index field. - Index *FilterNumber `json:"index,omitempty"` + Index *FilterInt `json:"index,omitempty"` // filter for hash field. Hash *FilterString `json:"hash,omitempty"` // filter for success field. Success *FilterBoolean `json:"success,omitempty"` // filter for block_height field. - BlockHeight *FilterNumber `json:"block_height,omitempty"` + BlockHeight *FilterInt `json:"block_height,omitempty"` // filter for gas_wanted field. - GasWanted *FilterNumber `json:"gas_wanted,omitempty"` + GasWanted *FilterInt `json:"gas_wanted,omitempty"` // filter for gas_used field. - GasUsed *FilterNumber `json:"gas_used,omitempty"` + GasUsed *FilterInt `json:"gas_used,omitempty"` // filter for gas_fee field. GasFee *NestedFilterCoin `json:"gas_fee,omitempty"` // filter for messages field. @@ -283,6 +445,8 @@ type FilterTransactionMessage struct { TypeURL *FilterString `json:"typeUrl,omitempty"` // filter for route field. Route *FilterString `json:"route,omitempty"` + // filter for value field. + Value *NestedFilterMessageValue `json:"value,omitempty"` } // filter for TransactionResponse objects @@ -301,6 +465,8 @@ type FilterTransactionResponse struct { Error *FilterString `json:"error,omitempty"` // filter for data field. Data *FilterString `json:"data,omitempty"` + // filter for events field. + Events *NestedFilterEvent `json:"events,omitempty"` } // filter for TxFee objects @@ -312,11 +478,23 @@ type FilterTxFee struct { // logical operator for TxFee that will reverse conditions. Not *FilterTxFee `json:"_not,omitempty"` // filter for gas_wanted field. - GasWanted *FilterNumber `json:"gas_wanted,omitempty"` + GasWanted *FilterInt `json:"gas_wanted,omitempty"` // filter for gas_fee field. GasFee *NestedFilterCoin `json:"gas_fee,omitempty"` } +// filter for UnknownEvent objects +type FilterUnknownEvent struct { + // logical operator for UnknownEvent that will combine two or more conditions, returning true if all of them are true. + And []*FilterUnknownEvent `json:"_and,omitempty"` + // logical operator for UnknownEvent that will combine two or more conditions, returning true if at least one of them is true. + Or []*FilterUnknownEvent `json:"_or,omitempty"` + // logical operator for UnknownEvent that will reverse conditions. + Not *FilterUnknownEvent `json:"_not,omitempty"` + // filter for value field. + Value *FilterString `json:"value,omitempty"` +} + // `GnoEvent` is the event information exported by the Gno VM. // It has `type`, `pkg_path`, `func`, and `attrs`. type GnoEvent struct { @@ -472,6 +650,22 @@ type MsgRunInput struct { Package *MemPackageInput `json:"package,omitempty"` } +// filter for BankMsgSend objects +type NestedFilterBankMsgSend struct { + // logical operator for BankMsgSend that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterBankMsgSend `json:"_and,omitempty"` + // logical operator for BankMsgSend that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterBankMsgSend `json:"_or,omitempty"` + // logical operator for BankMsgSend that will reverse conditions. + Not *NestedFilterBankMsgSend `json:"_not,omitempty"` + // filter for from_address field. + FromAddress *FilterString `json:"from_address,omitempty"` + // filter for to_address field. + ToAddress *FilterString `json:"to_address,omitempty"` + // filter for amount field. + Amount *FilterString `json:"amount,omitempty"` +} + // filter for BlockTransaction objects type NestedFilterBlockTransaction struct { // logical operator for BlockTransaction that will combine two or more conditions, returning true if all of them are true. @@ -497,11 +691,157 @@ type NestedFilterCoin struct { // logical operator for Coin that will reverse conditions. Not *NestedFilterCoin `json:"_not,omitempty"` // filter for amount field. - Amount *FilterNumber `json:"amount,omitempty"` + Amount *FilterInt `json:"amount,omitempty"` // filter for denom field. Denom *FilterString `json:"denom,omitempty"` } +// filter for Event objects +type NestedFilterEvent struct { + // logical operator for Event that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterEvent `json:"_and,omitempty"` + // logical operator for Event that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterEvent `json:"_or,omitempty"` + // logical operator for Event that will reverse conditions. + Not *NestedFilterEvent `json:"_not,omitempty"` + // filter for GnoEvent union type. + GnoEvent *NestedFilterGnoEvent `json:"GnoEvent,omitempty"` + // filter for UnknownEvent union type. + UnknownEvent *NestedFilterUnknownEvent `json:"UnknownEvent,omitempty"` +} + +// filter for GnoEvent objects +type NestedFilterGnoEvent struct { + // logical operator for GnoEvent that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterGnoEvent `json:"_and,omitempty"` + // logical operator for GnoEvent that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterGnoEvent `json:"_or,omitempty"` + // logical operator for GnoEvent that will reverse conditions. + Not *NestedFilterGnoEvent `json:"_not,omitempty"` + // filter for type field. + Type *FilterString `json:"type,omitempty"` + // filter for pkg_path field. + PkgPath *FilterString `json:"pkg_path,omitempty"` + // filter for func field. + Func *FilterString `json:"func,omitempty"` + // filter for attrs field. + Attrs *NestedFilterGnoEventAttribute `json:"attrs,omitempty"` +} + +// filter for GnoEventAttribute objects +type NestedFilterGnoEventAttribute struct { + // logical operator for GnoEventAttribute that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterGnoEventAttribute `json:"_and,omitempty"` + // logical operator for GnoEventAttribute that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterGnoEventAttribute `json:"_or,omitempty"` + // logical operator for GnoEventAttribute that will reverse conditions. + Not *NestedFilterGnoEventAttribute `json:"_not,omitempty"` + // filter for key field. + Key *FilterString `json:"key,omitempty"` + // filter for value field. + Value *FilterString `json:"value,omitempty"` +} + +// filter for MemFile objects +type NestedFilterMemFile struct { + // logical operator for MemFile that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterMemFile `json:"_and,omitempty"` + // logical operator for MemFile that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterMemFile `json:"_or,omitempty"` + // logical operator for MemFile that will reverse conditions. + Not *NestedFilterMemFile `json:"_not,omitempty"` + // filter for name field. + Name *FilterString `json:"name,omitempty"` + // filter for body field. + Body *FilterString `json:"body,omitempty"` +} + +// filter for MemPackage objects +type NestedFilterMemPackage struct { + // logical operator for MemPackage that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterMemPackage `json:"_and,omitempty"` + // logical operator for MemPackage that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterMemPackage `json:"_or,omitempty"` + // logical operator for MemPackage that will reverse conditions. + Not *NestedFilterMemPackage `json:"_not,omitempty"` + // filter for name field. + Name *FilterString `json:"name,omitempty"` + // filter for path field. + Path *FilterString `json:"path,omitempty"` + // filter for files field. + Files *NestedFilterMemFile `json:"files,omitempty"` +} + +// filter for MessageValue objects +type NestedFilterMessageValue struct { + // logical operator for MessageValue that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterMessageValue `json:"_and,omitempty"` + // logical operator for MessageValue that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterMessageValue `json:"_or,omitempty"` + // logical operator for MessageValue that will reverse conditions. + Not *NestedFilterMessageValue `json:"_not,omitempty"` + // filter for BankMsgSend union type. + BankMsgSend *NestedFilterBankMsgSend `json:"BankMsgSend,omitempty"` + // filter for MsgCall union type. + MsgCall *NestedFilterMsgCall `json:"MsgCall,omitempty"` + // filter for MsgAddPackage union type. + MsgAddPackage *NestedFilterMsgAddPackage `json:"MsgAddPackage,omitempty"` + // filter for MsgRun union type. + MsgRun *NestedFilterMsgRun `json:"MsgRun,omitempty"` +} + +// filter for MsgAddPackage objects +type NestedFilterMsgAddPackage struct { + // logical operator for MsgAddPackage that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterMsgAddPackage `json:"_and,omitempty"` + // logical operator for MsgAddPackage that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterMsgAddPackage `json:"_or,omitempty"` + // logical operator for MsgAddPackage that will reverse conditions. + Not *NestedFilterMsgAddPackage `json:"_not,omitempty"` + // filter for creator field. + Creator *FilterString `json:"creator,omitempty"` + // filter for package field. + Package *NestedFilterMemPackage `json:"package,omitempty"` + // filter for deposit field. + Deposit *FilterString `json:"deposit,omitempty"` +} + +// filter for MsgCall objects +type NestedFilterMsgCall struct { + // logical operator for MsgCall that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterMsgCall `json:"_and,omitempty"` + // logical operator for MsgCall that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterMsgCall `json:"_or,omitempty"` + // logical operator for MsgCall that will reverse conditions. + Not *NestedFilterMsgCall `json:"_not,omitempty"` + // filter for caller field. + Caller *FilterString `json:"caller,omitempty"` + // filter for send field. + Send *FilterString `json:"send,omitempty"` + // filter for pkg_path field. + PkgPath *FilterString `json:"pkg_path,omitempty"` + // filter for func field. + Func *FilterString `json:"func,omitempty"` + // filter for args field. + Args *FilterString `json:"args,omitempty"` +} + +// filter for MsgRun objects +type NestedFilterMsgRun struct { + // logical operator for MsgRun that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterMsgRun `json:"_and,omitempty"` + // logical operator for MsgRun that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterMsgRun `json:"_or,omitempty"` + // logical operator for MsgRun that will reverse conditions. + Not *NestedFilterMsgRun `json:"_not,omitempty"` + // filter for caller field. + Caller *FilterString `json:"caller,omitempty"` + // filter for send field. + Send *FilterString `json:"send,omitempty"` + // filter for package field. + Package *NestedFilterMemPackage `json:"package,omitempty"` +} + // filter for TransactionMessage objects type NestedFilterTransactionMessage struct { // logical operator for TransactionMessage that will combine two or more conditions, returning true if all of them are true. @@ -514,6 +854,8 @@ type NestedFilterTransactionMessage struct { TypeURL *FilterString `json:"typeUrl,omitempty"` // filter for route field. Route *FilterString `json:"route,omitempty"` + // filter for value field. + Value *NestedFilterMessageValue `json:"value,omitempty"` } // filter for TransactionResponse objects @@ -532,6 +874,8 @@ type NestedFilterTransactionResponse struct { Error *FilterString `json:"error,omitempty"` // filter for data field. Data *FilterString `json:"data,omitempty"` + // filter for events field. + Events *NestedFilterEvent `json:"events,omitempty"` } // filter for TxFee objects @@ -543,11 +887,23 @@ type NestedFilterTxFee struct { // logical operator for TxFee that will reverse conditions. Not *NestedFilterTxFee `json:"_not,omitempty"` // filter for gas_wanted field. - GasWanted *FilterNumber `json:"gas_wanted,omitempty"` + GasWanted *FilterInt `json:"gas_wanted,omitempty"` // filter for gas_fee field. GasFee *NestedFilterCoin `json:"gas_fee,omitempty"` } +// filter for UnknownEvent objects +type NestedFilterUnknownEvent struct { + // logical operator for UnknownEvent that will combine two or more conditions, returning true if all of them are true. + And []*NestedFilterUnknownEvent `json:"_and,omitempty"` + // logical operator for UnknownEvent that will combine two or more conditions, returning true if at least one of them is true. + Or []*NestedFilterUnknownEvent `json:"_or,omitempty"` + // logical operator for UnknownEvent that will reverse conditions. + Not *NestedFilterUnknownEvent `json:"_not,omitempty"` + // filter for value field. + Value *FilterString `json:"value,omitempty"` +} + // Root Query type to fetch data about Blocks and Transactions based on filters or retrieve the latest block height. type Query struct { } @@ -651,44 +1007,44 @@ type UnknownEvent struct { func (UnknownEvent) IsEvent() {} -type FilterableAddons string +type FilterableExtra string const ( // Get minimum and maximum value used on all the filters for this field. // Useful when you need to do a range query for performance reasons. - FilterableAddonsMinmax FilterableAddons = "MINMAX" + FilterableExtraMinmax FilterableExtra = "MINMAX" ) -var AllFilterableAddons = []FilterableAddons{ - FilterableAddonsMinmax, +var AllFilterableExtra = []FilterableExtra{ + FilterableExtraMinmax, } -func (e FilterableAddons) IsValid() bool { +func (e FilterableExtra) IsValid() bool { switch e { - case FilterableAddonsMinmax: + case FilterableExtraMinmax: return true } return false } -func (e FilterableAddons) String() string { +func (e FilterableExtra) String() string { return string(e) } -func (e *FilterableAddons) UnmarshalGQL(v interface{}) error { +func (e *FilterableExtra) UnmarshalGQL(v interface{}) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") } - *e = FilterableAddons(str) + *e = FilterableExtra(str) if !e.IsValid() { - return fmt.Errorf("%s is not a valid FilterableAddons", str) + return fmt.Errorf("%s is not a valid FilterableExtra", str) } return nil } -func (e FilterableAddons) MarshalGQL(w io.Writer) { +func (e FilterableExtra) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } diff --git a/serve/graph/schema/types/transaction.graphql b/serve/graph/schema/types/transaction.graphql index 8dd36195..ad31ac07 100644 --- a/serve/graph/schema/types/transaction.graphql +++ b/serve/graph/schema/types/transaction.graphql @@ -119,7 +119,7 @@ type TransactionMessage { MessageValue is the content of the transaction. `value` can be of type `BankMsgSend`, `MsgCall`, `MsgAddPackage`, `MsgRun`, `UnexpectedMessage`. """ - value: MessageValue! + value: MessageValue! @filterable } union MessageValue = BankMsgSend | MsgCall | MsgAddPackage | MsgRun | UnexpectedMessage @@ -133,19 +133,19 @@ type BankMsgSend { the bech32 address of the fund sender. ex) `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` """ - from_address: String! + from_address: String! @filterable """ the bech32 address of the fund receiver. ex) `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` """ - to_address: String! + to_address: String! @filterable """ the denomination and amount of fund sent (""). ex) `1000000ugnot` """ - amount: String! + amount: String! @filterable } """ @@ -157,28 +157,28 @@ type MsgCall { the bech32 address of the function caller. ex) `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` """ - caller: String! + caller: String! @filterable """ the amount of funds to be deposited to the package, if any (""). ex) `1000000ugnot` """ - send: String! + send: String! @filterable """ the gno package path. """ - pkg_path: String! + pkg_path: String! @filterable """ the function name being invoked. """ - func: String! + func: String! @filterable """ `args` are the arguments passed to the executed function. """ - args: [String!] + args: [String!] @filterable } """ @@ -190,18 +190,18 @@ type MsgAddPackage { the bech32 address of the package deployer. ex) `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` """ - creator: String! + creator: String! @filterable """ the package being deployed. """ - package: MemPackage! + package: MemPackage! @filterable """ the amount of funds to be deposited at deployment, if any (""). ex) `1000000ugnot` """ - deposit: String! + deposit: String! @filterable } """ @@ -213,18 +213,18 @@ type MsgRun { the bech32 address of the function caller. ex) `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` """ - caller: String! + caller: String! @filterable """ the amount of funds to be deposited to the package, if any (""). ex) `1000000ugnot` """ - send: String! + send: String! @filterable """ the package being executed. """ - package: MemPackage! + package: MemPackage! @filterable } """ @@ -241,17 +241,17 @@ type MemPackage { """ the name of the package. """ - name: String! + name: String! @filterable """ the gno path of the package. """ - path: String! + path: String! @filterable """ the associated package gno source. """ - files: [MemFile!] + files: [MemFile!] @filterable } """ @@ -261,12 +261,12 @@ type MemFile { """ the name of the source file. """ - name: String! + name: String! @filterable """ the content of the source file. """ - body: String! + body: String! @filterable } """ @@ -327,7 +327,7 @@ type TransactionResponse { """ The emitted events associated with the transaction execution, if any. """ - events: [Event] + events: [Event] @filterable } union Event = GnoEvent | UnknownEvent @@ -340,22 +340,22 @@ type GnoEvent { """ `type` is the type of transaction event emitted. """ - type: String! + type: String! @filterable """ `pkg_path` is the path to the package that emitted the event. """ - pkg_path: String! + pkg_path: String! @filterable """ `func` is the name of the function that emitted the event. """ - func: String! + func: String! @filterable """ `attrs` is the event's attribute information. """ - attrs: [GnoEventAttribute!] + attrs: [GnoEventAttribute!] @filterable } """ @@ -366,12 +366,12 @@ type GnoEventAttribute { """ The key of the event attribute. """ - key: String! + key: String! @filterable """ The value of the event attribute. """ - value: String! + value: String! @filterable } """ @@ -382,5 +382,5 @@ type UnknownEvent { """ `value` is a raw event string. """ - value: String! + value: String! @filterable } diff --git a/serve/graph/setup.go b/serve/graph/setup.go index 2fe8f754..d7e521eb 100644 --- a/serve/graph/setup.go +++ b/serve/graph/setup.go @@ -19,7 +19,7 @@ func Setup(s storage.Storage, manager *events.Manager, m *chi.Mux) *chi.Mux { Config{ Resolvers: NewResolver(s, manager), Directives: DirectiveRoot{ - Filterable: func(ctx context.Context, obj interface{}, next graphql.Resolver, extras []model.FilterableAddons) (res interface{}, err error) { + Filterable: func(ctx context.Context, obj interface{}, next graphql.Resolver, extras []model.FilterableExtra) (res interface{}, err error) { return next(ctx) }, }, From f542d3243448694efb68ada15be7efd561a906ca Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Wed, 18 Sep 2024 16:31:24 +0200 Subject: [PATCH 04/12] Add new filters Signed-off-by: Antonio Navarro Perez --- go.mod | 2 +- go.sum | 4 +- serve/graph/all.resolvers.go | 5 +- serve/graph/generated.go | 2960 +++++++++++++++++++++-- serve/graph/model/filter_methods_gen.go | 172 +- 5 files changed, 2816 insertions(+), 327 deletions(-) diff --git a/go.mod b/go.mod index dad21f01..513f1473 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.7 require ( github.com/99designs/gqlgen v0.17.54 - github.com/ajnavarro/gqlfiltergen v0.0.0-20240917141952-a5827c0f0dd7 + github.com/ajnavarro/gqlfiltergen v0.0.0-20240918141943-b05d2c9a83f1 github.com/cockroachdb/pebble v1.1.2 github.com/gnolang/gno v0.2.0 github.com/go-chi/chi/v5 v5.1.0 diff --git a/go.sum b/go.sum index 585c3cd5..e06b4803 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,8 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240917141952-a5827c0f0dd7 h1:+IWeSygkYmvIfhi5YWL0nnG+/1ynL6ANvTcsYPIYwoo= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240917141952-a5827c0f0dd7/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240918141943-b05d2c9a83f1 h1:VGStydpETwBG3RUUcb030XVWAd8z7CB8GzRO6CEoHXw= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240918141943-b05d2c9a83f1/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go index b47954b7..bd8f971f 100644 --- a/serve/graph/all.resolvers.go +++ b/serve/graph/all.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" @@ -177,7 +177,8 @@ func (r *queryResolver) GetBlocks(ctx context.Context, where model.FilterBlock) // GetTransactions is the resolver for the getTransactions field. func (r *queryResolver) GetTransactions(ctx context.Context, where model.FilterTransaction) ([]*model.Transaction, error) { // corner case - if where.Hash.Eq != nil && + if where.Hash != nil && + where.Hash.Eq != nil && len(where.Or) == 0 { tx, err := r.store.GetTxByHash(*where.Hash.Eq) if err != nil { diff --git a/serve/graph/generated.go b/serve/graph/generated.go index 4f87d55b..0513d16e 100644 --- a/serve/graph/generated.go +++ b/serve/graph/generated.go @@ -2831,12 +2831,12 @@ input TransactionFilter { """ hash: String """ - Transaction's message to filter Transactions. - ` + "`" + `messages` + "`" + ` can be configured as a filter with a transaction message's ` + "`" + `router` + "`" + ` and ` + "`" + `type` + "`" + ` and ` + "`" + `parameters(bank / vm)` + "`" + `. - ` + "`" + `messages` + "`" + ` is entered as an array and works exclusively. - ex) ` + "`" + `messages[0] || messages[1] || messages[2]` + "`" + ` + Transaction's messages to filter Transactions. + ` + "`" + `message` + "`" + ` can be configured as a filter with a transaction message's ` + "`" + `router` + "`" + ` and ` + "`" + `type` + "`" + ` and ` + "`" + `parameters(bank / vm)` + "`" + `. + ` + "`" + `message` + "`" + ` is entered as an array and works exclusively. + ex) ` + "`" + `message[0] || message[1] || message[2]` + "`" + ` """ - messages: [TransactionMessageInput!] + message: [TransactionMessageInput!] """ ` + "`" + `memo` + "`" + ` are string information stored within a transaction. ` + "`" + `memo` + "`" + ` can be utilized to find or distinguish transactions. @@ -2980,182 +2980,386 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) func (ec *executionContext) dir_filterable_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 []model.FilterableExtra - if tmp, ok := rawArgs["extras"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("extras")) - arg0, err = ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.dir_filterable_argsExtras(ctx, rawArgs) + if err != nil { + return nil, err } args["extras"] = arg0 return args, nil } +func (ec *executionContext) dir_filterable_argsExtras( + ctx context.Context, + rawArgs map[string]interface{}, +) ([]model.FilterableExtra, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["extras"] + if !ok { + var zeroVal []model.FilterableExtra + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("extras")) + if tmp, ok := rawArgs["extras"]; ok { + return ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, tmp) + } + + var zeroVal []model.FilterableExtra + return zeroVal, nil +} func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err } args["name"] = arg0 return args, nil } +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["name"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Query_blocks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.BlockFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_blocks_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_Query_blocks_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.BlockFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal model.BlockFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockFilter(ctx, tmp) + } + + var zeroVal model.BlockFilter + return zeroVal, nil +} func (ec *executionContext) field_Query_getBlocks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.FilterBlock - if tmp, ok := rawArgs["where"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg0, err = ec.unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_getBlocks_argsWhere(ctx, rawArgs) + if err != nil { + return nil, err } args["where"] = arg0 return args, nil } +func (ec *executionContext) field_Query_getBlocks_argsWhere( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.FilterBlock, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["where"] + if !ok { + var zeroVal model.FilterBlock + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + if tmp, ok := rawArgs["where"]; ok { + return ec.unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, tmp) + } + + var zeroVal model.FilterBlock + return zeroVal, nil +} func (ec *executionContext) field_Query_getTransactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.FilterTransaction - if tmp, ok := rawArgs["where"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) - arg0, err = ec.unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_getTransactions_argsWhere(ctx, rawArgs) + if err != nil { + return nil, err } args["where"] = arg0 return args, nil } +func (ec *executionContext) field_Query_getTransactions_argsWhere( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.FilterTransaction, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["where"] + if !ok { + var zeroVal model.FilterTransaction + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + if tmp, ok := rawArgs["where"]; ok { + return ec.unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, tmp) + } + + var zeroVal model.FilterTransaction + return zeroVal, nil +} func (ec *executionContext) field_Query_transactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.TransactionFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalNTransactionFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_transactions_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_Query_transactions_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.TransactionFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal model.TransactionFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalNTransactionFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionFilter(ctx, tmp) + } + + var zeroVal model.TransactionFilter + return zeroVal, nil +} func (ec *executionContext) field_Subscription_blocks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.BlockFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Subscription_blocks_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_Subscription_blocks_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.BlockFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal model.BlockFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockFilter(ctx, tmp) + } + + var zeroVal model.BlockFilter + return zeroVal, nil +} func (ec *executionContext) field_Subscription_getBlocks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.FilterBlock - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Subscription_getBlocks_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_Subscription_getBlocks_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.FilterBlock, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal model.FilterBlock + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, tmp) + } + + var zeroVal model.FilterBlock + return zeroVal, nil +} func (ec *executionContext) field_Subscription_getTransactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.FilterTransaction - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Subscription_getTransactions_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_Subscription_getTransactions_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.FilterTransaction, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal model.FilterTransaction + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, tmp) + } + + var zeroVal model.FilterTransaction + return zeroVal, nil +} func (ec *executionContext) field_Subscription_transactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.TransactionFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalNTransactionFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Subscription_transactions_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_Subscription_transactions_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.TransactionFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal model.TransactionFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalNTransactionFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionFilter(ctx, tmp) + } + + var zeroVal model.TransactionFilter + return zeroVal, nil +} func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err } args["includeDeprecated"] = arg0 return args, nil } +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]interface{}, +) (bool, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["includeDeprecated"] + if !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err } args["includeDeprecated"] = arg0 return args, nil } +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]interface{}, +) (bool, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["includeDeprecated"] + if !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} // endregion ***************************** args.gotpl ***************************** @@ -3182,9 +3386,11 @@ func (ec *executionContext) _BankMsgSend_from_address(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.FromAddress, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3246,9 +3452,11 @@ func (ec *executionContext) _BankMsgSend_to_address(ctx context.Context, field g ctx = rctx // use context from middleware stack in children return obj.ToAddress, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3310,9 +3518,11 @@ func (ec *executionContext) _BankMsgSend_amount(ctx context.Context, field graph ctx = rctx // use context from middleware stack in children return obj.Amount, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3374,9 +3584,11 @@ func (ec *executionContext) _Block_hash(ctx context.Context, field graphql.Colle ctx = rctx // use context from middleware stack in children return obj.Hash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3438,13 +3650,16 @@ func (ec *executionContext) _Block_height(ctx context.Context, field graphql.Col ctx = rctx // use context from middleware stack in children return obj.Height(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { extras, err := ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, []interface{}{"MINMAX"}) if err != nil { - return nil, err + var zeroVal int64 + return zeroVal, err } if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int64 + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, extras) } @@ -3506,9 +3721,11 @@ func (ec *executionContext) _Block_version(ctx context.Context, field graphql.Co ctx = rctx // use context from middleware stack in children return obj.Version(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3570,9 +3787,11 @@ func (ec *executionContext) _Block_chain_id(ctx context.Context, field graphql.C ctx = rctx // use context from middleware stack in children return obj.ChainID(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3634,9 +3853,11 @@ func (ec *executionContext) _Block_time(ctx context.Context, field graphql.Colle ctx = rctx // use context from middleware stack in children return obj.Time(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal time.Time + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3698,9 +3919,11 @@ func (ec *executionContext) _Block_num_txs(ctx context.Context, field graphql.Co ctx = rctx // use context from middleware stack in children return obj.NumTxs(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int64 + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3762,9 +3985,11 @@ func (ec *executionContext) _Block_total_txs(ctx context.Context, field graphql. ctx = rctx // use context from middleware stack in children return obj.TotalTxs(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int64 + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3826,9 +4051,11 @@ func (ec *executionContext) _Block_app_version(ctx context.Context, field graphq ctx = rctx // use context from middleware stack in children return obj.AppVersion(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3890,9 +4117,11 @@ func (ec *executionContext) _Block_last_block_hash(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.LastBlockHash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -3954,9 +4183,11 @@ func (ec *executionContext) _Block_last_commit_hash(ctx context.Context, field g ctx = rctx // use context from middleware stack in children return obj.LastCommitHash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4018,9 +4249,11 @@ func (ec *executionContext) _Block_validators_hash(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.ValidatorsHash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4082,9 +4315,11 @@ func (ec *executionContext) _Block_next_validators_hash(ctx context.Context, fie ctx = rctx // use context from middleware stack in children return obj.NextValidatorsHash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4146,9 +4381,11 @@ func (ec *executionContext) _Block_consensus_hash(ctx context.Context, field gra ctx = rctx // use context from middleware stack in children return obj.ConsensusHash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4210,9 +4447,11 @@ func (ec *executionContext) _Block_app_hash(ctx context.Context, field graphql.C ctx = rctx // use context from middleware stack in children return obj.AppHash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4274,9 +4513,11 @@ func (ec *executionContext) _Block_last_results_hash(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.LastResultsHash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4338,9 +4579,11 @@ func (ec *executionContext) _Block_proposer_address_raw(ctx context.Context, fie ctx = rctx // use context from middleware stack in children return obj.ProposerAddressRaw(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4402,9 +4645,11 @@ func (ec *executionContext) _Block_txs(ctx context.Context, field graphql.Collec ctx = rctx // use context from middleware stack in children return obj.Txs(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal []*model.BlockTransaction + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4476,9 +4721,11 @@ func (ec *executionContext) _BlockTransaction_hash(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.Hash, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4540,9 +4787,11 @@ func (ec *executionContext) _BlockTransaction_fee(ctx context.Context, field gra ctx = rctx // use context from middleware stack in children return obj.Fee, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal *model.TxFee + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4610,9 +4859,11 @@ func (ec *executionContext) _BlockTransaction_memo(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.Memo, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4718,9 +4969,11 @@ func (ec *executionContext) _Coin_amount(ctx context.Context, field graphql.Coll ctx = rctx // use context from middleware stack in children return obj.Amount, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4782,9 +5035,11 @@ func (ec *executionContext) _Coin_denom(ctx context.Context, field graphql.Colle ctx = rctx // use context from middleware stack in children return obj.Denom, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4846,9 +5101,11 @@ func (ec *executionContext) _GnoEvent_type(ctx context.Context, field graphql.Co ctx = rctx // use context from middleware stack in children return obj.Type, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4910,9 +5167,11 @@ func (ec *executionContext) _GnoEvent_pkg_path(ctx context.Context, field graphq ctx = rctx // use context from middleware stack in children return obj.PkgPath, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -4974,9 +5233,11 @@ func (ec *executionContext) _GnoEvent_func(ctx context.Context, field graphql.Co ctx = rctx // use context from middleware stack in children return obj.Func, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5038,9 +5299,11 @@ func (ec *executionContext) _GnoEvent_attrs(ctx context.Context, field graphql.C ctx = rctx // use context from middleware stack in children return obj.Attrs, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal []*model.GnoEventAttribute + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5105,9 +5368,11 @@ func (ec *executionContext) _GnoEventAttribute_key(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.Key, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5169,9 +5434,11 @@ func (ec *executionContext) _GnoEventAttribute_value(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.Value, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5233,9 +5500,11 @@ func (ec *executionContext) _MemFile_name(ctx context.Context, field graphql.Col ctx = rctx // use context from middleware stack in children return obj.Name, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5297,9 +5566,11 @@ func (ec *executionContext) _MemFile_body(ctx context.Context, field graphql.Col ctx = rctx // use context from middleware stack in children return obj.Body, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5361,9 +5632,11 @@ func (ec *executionContext) _MemPackage_name(ctx context.Context, field graphql. ctx = rctx // use context from middleware stack in children return obj.Name, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5425,9 +5698,11 @@ func (ec *executionContext) _MemPackage_path(ctx context.Context, field graphql. ctx = rctx // use context from middleware stack in children return obj.Path, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5489,9 +5764,11 @@ func (ec *executionContext) _MemPackage_files(ctx context.Context, field graphql ctx = rctx // use context from middleware stack in children return obj.Files, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal []*model.MemFile + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5556,9 +5833,11 @@ func (ec *executionContext) _MsgAddPackage_creator(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.Creator, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5620,9 +5899,11 @@ func (ec *executionContext) _MsgAddPackage_package(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.Package, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal *model.MemPackage + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5692,9 +5973,11 @@ func (ec *executionContext) _MsgAddPackage_deposit(ctx context.Context, field gr ctx = rctx // use context from middleware stack in children return obj.Deposit, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5756,9 +6039,11 @@ func (ec *executionContext) _MsgCall_caller(ctx context.Context, field graphql.C ctx = rctx // use context from middleware stack in children return obj.Caller, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5820,9 +6105,11 @@ func (ec *executionContext) _MsgCall_send(ctx context.Context, field graphql.Col ctx = rctx // use context from middleware stack in children return obj.Send, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5884,9 +6171,11 @@ func (ec *executionContext) _MsgCall_pkg_path(ctx context.Context, field graphql ctx = rctx // use context from middleware stack in children return obj.PkgPath, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -5948,9 +6237,11 @@ func (ec *executionContext) _MsgCall_func(ctx context.Context, field graphql.Col ctx = rctx // use context from middleware stack in children return obj.Func, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -6012,9 +6303,11 @@ func (ec *executionContext) _MsgCall_args(ctx context.Context, field graphql.Col ctx = rctx // use context from middleware stack in children return obj.Args, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal []string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -6073,9 +6366,11 @@ func (ec *executionContext) _MsgRun_caller(ctx context.Context, field graphql.Co ctx = rctx // use context from middleware stack in children return obj.Caller, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -6137,9 +6432,11 @@ func (ec *executionContext) _MsgRun_send(ctx context.Context, field graphql.Coll ctx = rctx // use context from middleware stack in children return obj.Send, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -6201,9 +6498,11 @@ func (ec *executionContext) _MsgRun_package(ctx context.Context, field graphql.C ctx = rctx // use context from middleware stack in children return obj.Package, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal *model.MemPackage + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7170,13 +7469,16 @@ func (ec *executionContext) _Transaction_index(ctx context.Context, field graphq ctx = rctx // use context from middleware stack in children return obj.Index(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { extras, err := ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, []interface{}{"MINMAX"}) if err != nil { - return nil, err + var zeroVal int + return zeroVal, err } if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, extras) } @@ -7238,9 +7540,11 @@ func (ec *executionContext) _Transaction_hash(ctx context.Context, field graphql ctx = rctx // use context from middleware stack in children return obj.Hash(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7302,9 +7606,11 @@ func (ec *executionContext) _Transaction_success(ctx context.Context, field grap ctx = rctx // use context from middleware stack in children return obj.Success(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal bool + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7366,13 +7672,16 @@ func (ec *executionContext) _Transaction_block_height(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.BlockHeight(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { extras, err := ec.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, []interface{}{"MINMAX"}) if err != nil { - return nil, err + var zeroVal int + return zeroVal, err } if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, extras) } @@ -7434,9 +7743,11 @@ func (ec *executionContext) _Transaction_gas_wanted(ctx context.Context, field g ctx = rctx // use context from middleware stack in children return obj.GasWanted(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7498,9 +7809,11 @@ func (ec *executionContext) _Transaction_gas_used(ctx context.Context, field gra ctx = rctx // use context from middleware stack in children return obj.GasUsed(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7562,9 +7875,11 @@ func (ec *executionContext) _Transaction_gas_fee(ctx context.Context, field grap ctx = rctx // use context from middleware stack in children return obj.GasFee(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal *model.Coin + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7673,9 +7988,11 @@ func (ec *executionContext) _Transaction_messages(ctx context.Context, field gra ctx = rctx // use context from middleware stack in children return obj.Messages(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal []*model.TransactionMessage + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7745,9 +8062,11 @@ func (ec *executionContext) _Transaction_memo(ctx context.Context, field graphql ctx = rctx // use context from middleware stack in children return obj.Memo(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7809,9 +8128,11 @@ func (ec *executionContext) _Transaction_response(ctx context.Context, field gra ctx = rctx // use context from middleware stack in children return obj.Response(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal *model.TransactionResponse + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7885,9 +8206,11 @@ func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, fie ctx = rctx // use context from middleware stack in children return obj.TypeURL, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -7949,9 +8272,11 @@ func (ec *executionContext) _TransactionMessage_route(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.Route, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8013,9 +8338,11 @@ func (ec *executionContext) _TransactionMessage_value(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.Value, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal model.MessageValue + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8077,9 +8404,11 @@ func (ec *executionContext) _TransactionResponse_log(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.Log(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8141,9 +8470,11 @@ func (ec *executionContext) _TransactionResponse_info(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.Info(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8205,9 +8536,11 @@ func (ec *executionContext) _TransactionResponse_error(ctx context.Context, fiel ctx = rctx // use context from middleware stack in children return obj.Error(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8269,9 +8602,11 @@ func (ec *executionContext) _TransactionResponse_data(ctx context.Context, field ctx = rctx // use context from middleware stack in children return obj.Data(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8333,9 +8668,11 @@ func (ec *executionContext) _TransactionResponse_events(ctx context.Context, fie ctx = rctx // use context from middleware stack in children return obj.Events(), nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal []model.Event + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8394,9 +8731,11 @@ func (ec *executionContext) _TxFee_gas_wanted(ctx context.Context, field graphql ctx = rctx // use context from middleware stack in children return obj.GasWanted, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal int + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8458,9 +8797,11 @@ func (ec *executionContext) _TxFee_gas_fee(ctx context.Context, field graphql.Co ctx = rctx // use context from middleware stack in children return obj.GasFee, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal *model.Coin + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -8572,9 +8913,11 @@ func (ec *executionContext) _UnknownEvent_value(ctx context.Context, field graph ctx = rctx // use context from middleware stack in children return obj.Value, nil } + directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.Filterable == nil { - return nil, errors.New("directive filterable is not implemented") + var zeroVal string + return zeroVal, errors.New("directive filterable is not implemented") } return ec.directives.Filterable(ctx, obj, directive0, nil) } @@ -13492,15 +13835,27 @@ func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, ob case nil: return graphql.Null case model.GnoEvent: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "GnoEvent"})) == 0 { + return graphql.Empty{} + } return ec._GnoEvent(ctx, sel, &obj) case *model.GnoEvent: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "GnoEvent"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._GnoEvent(ctx, sel, obj) case model.UnknownEvent: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "UnknownEvent"})) == 0 { + return graphql.Empty{} + } return ec._UnknownEvent(ctx, sel, &obj) case *model.UnknownEvent: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "UnknownEvent"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } @@ -13515,36 +13870,66 @@ func (ec *executionContext) _MessageValue(ctx context.Context, sel ast.Selection case nil: return graphql.Null case model.BankMsgSend: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "BankMsgSend"})) == 0 { + return graphql.Empty{} + } return ec._BankMsgSend(ctx, sel, &obj) case *model.BankMsgSend: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "BankMsgSend"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._BankMsgSend(ctx, sel, obj) case model.MsgCall: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgCall"})) == 0 { + return graphql.Empty{} + } return ec._MsgCall(ctx, sel, &obj) case *model.MsgCall: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgCall"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._MsgCall(ctx, sel, obj) case model.MsgAddPackage: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgAddPackage"})) == 0 { + return graphql.Empty{} + } return ec._MsgAddPackage(ctx, sel, &obj) case *model.MsgAddPackage: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgAddPackage"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._MsgAddPackage(ctx, sel, obj) case model.MsgRun: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgRun"})) == 0 { + return graphql.Empty{} + } return ec._MsgRun(ctx, sel, &obj) case *model.MsgRun: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgRun"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._MsgRun(ctx, sel, obj) case model.UnexpectedMessage: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "UnexpectedMessage"})) == 0 { + return graphql.Empty{} + } return ec._UnexpectedMessage(ctx, sel, &obj) case *model.UnexpectedMessage: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "UnexpectedMessage"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } @@ -13570,16 +13955,76 @@ func (ec *executionContext) _BankMsgSend(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("BankMsgSend") case "from_address": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BankMsgSend_from_address(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BankMsgSend_from_address(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "to_address": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BankMsgSend_to_address(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BankMsgSend_to_address(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "amount": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BankMsgSend_amount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BankMsgSend_amount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -13619,86 +14064,426 @@ func (ec *executionContext) _Block(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Block") case "hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "height": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_height(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_height(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "version": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_version(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_version(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "chain_id": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_chain_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_chain_id(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "time": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_time(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_time(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "num_txs": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_num_txs(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_num_txs(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "total_txs": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_total_txs(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_total_txs(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "app_version": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_app_version(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_app_version(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "last_block_hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_last_block_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_last_block_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "last_commit_hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_last_commit_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_last_commit_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "validators_hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_validators_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_validators_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "next_validators_hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_next_validators_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_next_validators_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "consensus_hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_consensus_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_consensus_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "app_hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_app_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_app_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "last_results_hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_last_results_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_last_results_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "proposer_address_raw": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_proposer_address_raw(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_proposer_address_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "txs": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Block_txs(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Block_txs(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -13738,21 +14523,101 @@ func (ec *executionContext) _BlockTransaction(ctx context.Context, sel ast.Selec case "__typename": out.Values[i] = graphql.MarshalString("BlockTransaction") case "hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BlockTransaction_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BlockTransaction_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "fee": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BlockTransaction_fee(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BlockTransaction_fee(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "memo": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BlockTransaction_memo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BlockTransaction_memo(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "content_raw": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BlockTransaction_content_raw(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BlockTransaction_content_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -13792,11 +14657,51 @@ func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Coin") case "amount": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Coin_amount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Coin_amount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "denom": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Coin_denom(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Coin_denom(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -13836,21 +14741,101 @@ func (ec *executionContext) _GnoEvent(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("GnoEvent") case "type": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._GnoEvent_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._GnoEvent_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "pkg_path": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._GnoEvent_pkg_path(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._GnoEvent_pkg_path(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "func": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._GnoEvent_func(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._GnoEvent_func(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "attrs": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._GnoEvent_attrs(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._GnoEvent_attrs(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -13887,11 +14872,51 @@ func (ec *executionContext) _GnoEventAttribute(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("GnoEventAttribute") case "key": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._GnoEventAttribute_key(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._GnoEventAttribute_key(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "value": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._GnoEventAttribute_value(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._GnoEventAttribute_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -13931,11 +14956,51 @@ func (ec *executionContext) _MemFile(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("MemFile") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MemFile_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MemFile_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "body": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MemFile_body(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MemFile_body(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -13975,16 +15040,76 @@ func (ec *executionContext) _MemPackage(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("MemPackage") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MemPackage_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MemPackage_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "path": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MemPackage_path(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MemPackage_path(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "files": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MemPackage_files(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MemPackage_files(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14021,16 +15146,76 @@ func (ec *executionContext) _MsgAddPackage(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("MsgAddPackage") case "creator": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgAddPackage_creator(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgAddPackage_creator(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "package": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgAddPackage_package(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgAddPackage_package(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deposit": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgAddPackage_deposit(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgAddPackage_deposit(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14070,26 +15255,126 @@ func (ec *executionContext) _MsgCall(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("MsgCall") case "caller": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgCall_caller(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgCall_caller(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "send": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgCall_send(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgCall_send(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "pkg_path": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgCall_pkg_path(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgCall_pkg_path(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "func": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgCall_func(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgCall_func(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "args": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgCall_args(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgCall_args(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14126,16 +15411,76 @@ func (ec *executionContext) _MsgRun(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("MsgRun") case "caller": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgRun_caller(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgRun_caller(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "send": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgRun_send(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgRun_send(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "package": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MsgRun_package(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MsgRun_package(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14185,106 +15530,45 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "transactions": field := field - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_transactions(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_transactions(ctx, field) + }) case "blocks": field := field - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_blocks(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_blocks(ctx, field) + }) case "latestBlockHeight": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_latestBlockHeight(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_latestBlockHeight(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "getBlocks": field := field - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_getBlocks(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_getBlocks(ctx, field) + }) case "getTransactions": field := field - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_getTransactions(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_getTransactions(ctx, field) + }) case "__type": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___type(ctx, field) }) case "__schema": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___schema(ctx, field) }) @@ -14349,53 +15633,273 @@ func (ec *executionContext) _Transaction(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("Transaction") case "index": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_index(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_index(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "hash": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_hash(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "success": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_success(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_success(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "block_height": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_block_height(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_block_height(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_wanted": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_gas_wanted(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_gas_wanted(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_used": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_gas_used(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_gas_used(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_fee": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_gas_fee(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_gas_fee(ctx, field, obj) case "content_raw": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_content_raw(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_content_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "messages": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_messages(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_messages(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "memo": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_memo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_memo(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "response": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Transaction_response(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Transaction_response(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14435,16 +15939,76 @@ func (ec *executionContext) _TransactionMessage(ctx context.Context, sel ast.Sel case "__typename": out.Values[i] = graphql.MarshalString("TransactionMessage") case "typeUrl": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionMessage_typeUrl(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionMessage_typeUrl(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "route": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionMessage_route(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionMessage_route(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "value": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionMessage_value(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionMessage_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14484,26 +16048,126 @@ func (ec *executionContext) _TransactionResponse(ctx context.Context, sel ast.Se case "__typename": out.Values[i] = graphql.MarshalString("TransactionResponse") case "log": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionResponse_log(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionResponse_log(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "info": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionResponse_info(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionResponse_info(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "error": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionResponse_error(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionResponse_error(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "data": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionResponse_data(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionResponse_data(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "events": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TransactionResponse_events(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TransactionResponse_events(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14540,11 +16204,51 @@ func (ec *executionContext) _TxFee(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("TxFee") case "gas_wanted": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TxFee_gas_wanted(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TxFee_gas_wanted(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_fee": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._TxFee_gas_fee(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._TxFee_gas_fee(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14584,6 +16288,26 @@ func (ec *executionContext) _UnexpectedMessage(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("UnexpectedMessage") case "raw": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._UnexpectedMessage_raw(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._UnexpectedMessage_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14623,6 +16347,26 @@ func (ec *executionContext) _UnknownEvent(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("UnknownEvent") case "value": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._UnknownEvent_value(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._UnknownEvent_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14662,23 +16406,123 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_locations(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "args": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_args(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isRepeatable": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_isRepeatable(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14718,18 +16562,98 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_isDeprecated(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_deprecationReason(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14766,28 +16690,148 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_args(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "type": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isDeprecated": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_isDeprecated(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_deprecationReason(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14824,18 +16868,98 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "defaultValue": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_defaultValue(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14872,22 +16996,142 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_types(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "queryType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_queryType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "mutationType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_mutationType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_subscriptionType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_directives(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14927,27 +17171,227 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_kind(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_fields(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_interfaces(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_possibleTypes(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_enumValues(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_inputFields(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_ofType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_specifiedByURL(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14998,7 +17442,7 @@ func (ec *executionContext) unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑ func (ec *executionContext) marshalNBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx context.Context, sel ast.SelectionSet, v []*model.BlockTransaction) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -15210,7 +17654,7 @@ func (ec *executionContext) unmarshalNTransactionFilter2githubᚗcomᚋgnolang func (ec *executionContext) marshalNTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessage(ctx context.Context, sel ast.SelectionSet, v []*model.TransactionMessage) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -15277,7 +17721,7 @@ func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -15353,7 +17797,7 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -15409,7 +17853,7 @@ func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlg func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -15457,7 +17901,7 @@ func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋg func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -15545,7 +17989,7 @@ func (ec *executionContext) marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑin } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -15639,7 +18083,7 @@ func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindex } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -16276,7 +18720,7 @@ func (ec *executionContext) marshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋ } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -16323,7 +18767,7 @@ func (ec *executionContext) marshalOGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnola } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -16386,7 +18830,7 @@ func (ec *executionContext) marshalOMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑ } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -17043,7 +19487,7 @@ func (ec *executionContext) marshalOTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋt } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -17133,7 +19577,7 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgq } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -17180,7 +19624,7 @@ func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -17227,7 +19671,7 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋg } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -17281,7 +19725,7 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } diff --git a/serve/graph/model/filter_methods_gen.go b/serve/graph/model/filter_methods_gen.go index 4d586c92..80e94a20 100644 --- a/serve/graph/model/filter_methods_gen.go +++ b/serve/graph/model/filter_methods_gen.go @@ -415,40 +415,50 @@ func (f *NestedFilterMessageValue) Eval(obj *MessageValue) bool { } // Handle union objects depending of the type - tobj := *obj - switch objv := tobj.(type) { - case BankMsgSend: - // Handle BankMsgSend field - toEvalBankMsgSend := objv - if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&toEvalBankMsgSend) { - return false - } + // Check if any filters are specified + filtersSpecified := f.BankMsgSend != nil || f.MsgCall != nil || f.MsgAddPackage != nil || f.MsgRun != nil || false - case MsgCall: + // If no filters are specified for any types, accept all objects + if !filtersSpecified { + return true + } + + // Evaluate specified type filters + matchedType := false - // Handle MsgCall field - toEvalMsgCall := objv - if f.MsgCall != nil && !f.MsgCall.Eval(&toEvalMsgCall) { + tobj := *obj + if uObj, ok := tobj.(BankMsgSend); ok { + matchedType = true + if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&uObj) { return false } + } - case MsgAddPackage: - - // Handle MsgAddPackage field - toEvalMsgAddPackage := objv - if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&toEvalMsgAddPackage) { + if uObj, ok := tobj.(MsgCall); ok { + matchedType = true + if f.MsgCall != nil && !f.MsgCall.Eval(&uObj) { return false } + } - case MsgRun: + if uObj, ok := tobj.(MsgAddPackage); ok { + matchedType = true + if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&uObj) { + return false + } + } - // Handle MsgRun field - toEvalMsgRun := objv - if f.MsgRun != nil && !f.MsgRun.Eval(&toEvalMsgRun) { + if uObj, ok := tobj.(MsgRun); ok { + matchedType = true + if f.MsgRun != nil && !f.MsgRun.Eval(&uObj) { return false } + } + // If the object is of a type not specified in filters and filters are specified, ignore this element + if !matchedType { + return true } return true @@ -692,24 +702,36 @@ func (f *NestedFilterEvent) Eval(obj *Event) bool { } // Handle union objects depending of the type - tobj := *obj - switch objv := tobj.(type) { - case GnoEvent: - // Handle GnoEvent field - toEvalGnoEvent := objv - if f.GnoEvent != nil && !f.GnoEvent.Eval(&toEvalGnoEvent) { + // Check if any filters are specified + filtersSpecified := f.GnoEvent != nil || f.UnknownEvent != nil || false + + // If no filters are specified for any types, accept all objects + if !filtersSpecified { + return true + } + + // Evaluate specified type filters + matchedType := false + + tobj := *obj + if uObj, ok := tobj.(GnoEvent); ok { + matchedType = true + if f.GnoEvent != nil && !f.GnoEvent.Eval(&uObj) { return false } + } - case UnknownEvent: - - // Handle UnknownEvent field - toEvalUnknownEvent := objv - if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&toEvalUnknownEvent) { + if uObj, ok := tobj.(UnknownEvent); ok { + matchedType = true + if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&uObj) { return false } + } + // If the object is of a type not specified in filters and filters are specified, ignore this element + if !matchedType { + return true } return true @@ -1488,40 +1510,50 @@ func (f *FilterMessageValue) Eval(obj *MessageValue) bool { } // Handle union objects depending of the type - tobj := *obj - switch objv := tobj.(type) { - case BankMsgSend: - // Handle BankMsgSend field - toEvalBankMsgSend := objv - if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&toEvalBankMsgSend) { - return false - } + // Check if any filters are specified + filtersSpecified := f.BankMsgSend != nil || f.MsgCall != nil || f.MsgAddPackage != nil || f.MsgRun != nil || false - case MsgCall: + // If no filters are specified for any types, accept all objects + if !filtersSpecified { + return true + } + + // Evaluate specified type filters + matchedType := false - // Handle MsgCall field - toEvalMsgCall := objv - if f.MsgCall != nil && !f.MsgCall.Eval(&toEvalMsgCall) { + tobj := *obj + if uObj, ok := tobj.(BankMsgSend); ok { + matchedType = true + if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&uObj) { return false } + } - case MsgAddPackage: - - // Handle MsgAddPackage field - toEvalMsgAddPackage := objv - if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&toEvalMsgAddPackage) { + if uObj, ok := tobj.(MsgCall); ok { + matchedType = true + if f.MsgCall != nil && !f.MsgCall.Eval(&uObj) { return false } + } - case MsgRun: + if uObj, ok := tobj.(MsgAddPackage); ok { + matchedType = true + if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&uObj) { + return false + } + } - // Handle MsgRun field - toEvalMsgRun := objv - if f.MsgRun != nil && !f.MsgRun.Eval(&toEvalMsgRun) { + if uObj, ok := tobj.(MsgRun); ok { + matchedType = true + if f.MsgRun != nil && !f.MsgRun.Eval(&uObj) { return false } + } + // If the object is of a type not specified in filters and filters are specified, ignore this element + if !matchedType { + return true } return true @@ -1765,24 +1797,36 @@ func (f *FilterEvent) Eval(obj *Event) bool { } // Handle union objects depending of the type - tobj := *obj - switch objv := tobj.(type) { - case GnoEvent: - // Handle GnoEvent field - toEvalGnoEvent := objv - if f.GnoEvent != nil && !f.GnoEvent.Eval(&toEvalGnoEvent) { + // Check if any filters are specified + filtersSpecified := f.GnoEvent != nil || f.UnknownEvent != nil || false + + // If no filters are specified for any types, accept all objects + if !filtersSpecified { + return true + } + + // Evaluate specified type filters + matchedType := false + + tobj := *obj + if uObj, ok := tobj.(GnoEvent); ok { + matchedType = true + if f.GnoEvent != nil && !f.GnoEvent.Eval(&uObj) { return false } + } - case UnknownEvent: - - // Handle UnknownEvent field - toEvalUnknownEvent := objv - if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&toEvalUnknownEvent) { + if uObj, ok := tobj.(UnknownEvent); ok { + matchedType = true + if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&uObj) { return false } + } + // If the object is of a type not specified in filters and filters are specified, ignore this element + if !matchedType { + return true } return true From 4149dab3963b74d3bea5e90d2d179896fded1f9b Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Thu, 19 Sep 2024 13:19:36 +0200 Subject: [PATCH 05/12] Add examples to simplify new API usage Signed-off-by: Antonio Navarro Perez --- go.mod | 2 +- go.sum | 8 +- .../get_all_packages_importing_validators.gql | 19 ++ .../examples/get_all_registered_users.gql | 14 ++ serve/graph/model/filter_methods_gen.go | 172 ++++++++++++------ serve/graph/playground.go | 139 ++++++++++++++ serve/graph/setup.go | 33 +++- 7 files changed, 322 insertions(+), 65 deletions(-) create mode 100644 serve/graph/examples/get_all_packages_importing_validators.gql create mode 100644 serve/graph/examples/get_all_registered_users.gql create mode 100644 serve/graph/playground.go diff --git a/go.mod b/go.mod index 513f1473..5da7bd87 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.7 require ( github.com/99designs/gqlgen v0.17.54 - github.com/ajnavarro/gqlfiltergen v0.0.0-20240918141943-b05d2c9a83f1 + github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 github.com/cockroachdb/pebble v1.1.2 github.com/gnolang/gno v0.2.0 github.com/go-chi/chi/v5 v5.1.0 diff --git a/go.sum b/go.sum index e06b4803..82d3397a 100644 --- a/go.sum +++ b/go.sum @@ -4,19 +4,15 @@ github.com/99designs/gqlgen v0.17.54 h1:AsF49k/7RJlwA00RQYsYN0T8cQuaosnV/7G1dHC3 github.com/99designs/gqlgen v0.17.54/go.mod h1:77/+pVe6zlTsz++oUg2m8VLgzdUPHxjoAG3BxI5y8Rc= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/PuerkitoBio/goquery v1.9.3 h1:mpJr/ikUA9/GNJB/DBZcGeFDXUtosHRyRrwh7KGdTG0= -github.com/PuerkitoBio/goquery v1.9.3/go.mod h1:1ndLHPdTz+DyQPICCWYlYQMPl0oXZj0G6D4LCYA6u4U= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240918141943-b05d2c9a83f1 h1:VGStydpETwBG3RUUcb030XVWAd8z7CB8GzRO6CEoHXw= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240918141943-b05d2c9a83f1/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 h1:P5k+90SdRIMnbLvreMZ/UmrnagcS4Sd6VdANboAG7C0= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= -github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= diff --git a/serve/graph/examples/get_all_packages_importing_validators.gql b/serve/graph/examples/get_all_packages_importing_validators.gql new file mode 100644 index 00000000..70873765 --- /dev/null +++ b/serve/graph/examples/get_all_packages_importing_validators.gql @@ -0,0 +1,19 @@ +query getAllPackagesImportingValidators { + getTransactions( + where: {messages: {value: {MsgAddPackage: {package: {files: {body: {like: "gno.land/p/sys/validators"}}}}}}} + ) { + messages { + value { + ... on MsgAddPackage { + creator + package { + name + files { + name + } + } + } + } + } + } +} \ No newline at end of file diff --git a/serve/graph/examples/get_all_registered_users.gql b/serve/graph/examples/get_all_registered_users.gql new file mode 100644 index 00000000..4fdbaf99 --- /dev/null +++ b/serve/graph/examples/get_all_registered_users.gql @@ -0,0 +1,14 @@ +query getAllRegisteredUsers { + getTransactions( + where: {messages: {value: {MsgCall: {func: {eq: "Register"}, pkg_path: {eq: "gno.land/r/demo/users"}}}}} + ) { + messages { + value { + ... on MsgCall { + caller + args + } + } + } + } +} \ No newline at end of file diff --git a/serve/graph/model/filter_methods_gen.go b/serve/graph/model/filter_methods_gen.go index 80e94a20..2876d976 100644 --- a/serve/graph/model/filter_methods_gen.go +++ b/serve/graph/model/filter_methods_gen.go @@ -140,11 +140,17 @@ func (f *NestedFilterTransactionResponse) Eval(obj *TransactionResponse) bool { // Handle Events slice if f.Events != nil { + elemMatchEvents := false for _, elem := range obj.Events() { - if !f.Events.Eval(&elem) { - return false + if f.Events.Eval(&elem) { + elemMatchEvents = true } } + + if !elemMatchEvents { + return false + } + } // Handle Error field @@ -323,11 +329,17 @@ func (f *NestedFilterMsgCall) Eval(obj *MsgCall) bool { // Handle Args slice if f.Args != nil { + elemMatchArgs := false for _, elem := range obj.Args { - if !f.Args.Eval(&elem) { - return false + if f.Args.Eval(&elem) { + elemMatchArgs = true } } + + if !elemMatchArgs { + return false + } + } return true @@ -430,35 +442,35 @@ func (f *NestedFilterMessageValue) Eval(obj *MessageValue) bool { tobj := *obj if uObj, ok := tobj.(BankMsgSend); ok { matchedType = true - if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&uObj) { - return false + if f.BankMsgSend != nil && f.BankMsgSend.Eval(&uObj) { + return true } } if uObj, ok := tobj.(MsgCall); ok { matchedType = true - if f.MsgCall != nil && !f.MsgCall.Eval(&uObj) { - return false + if f.MsgCall != nil && f.MsgCall.Eval(&uObj) { + return true } } if uObj, ok := tobj.(MsgAddPackage); ok { matchedType = true - if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&uObj) { - return false + if f.MsgAddPackage != nil && f.MsgAddPackage.Eval(&uObj) { + return true } } if uObj, ok := tobj.(MsgRun); ok { matchedType = true - if f.MsgRun != nil && !f.MsgRun.Eval(&uObj) { - return false + if f.MsgRun != nil && f.MsgRun.Eval(&uObj) { + return true } } - // If the object is of a type not specified in filters and filters are specified, ignore this element - if !matchedType { - return true + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + return false } return true @@ -509,11 +521,17 @@ func (f *NestedFilterMemPackage) Eval(obj *MemPackage) bool { // Handle Files slice if f.Files != nil { + elemMatchFiles := false for _, elem := range obj.Files { - if !f.Files.Eval(elem) { - return false + if f.Files.Eval(elem) { + elemMatchFiles = true } } + + if !elemMatchFiles { + return false + } + } return true @@ -662,11 +680,17 @@ func (f *NestedFilterGnoEvent) Eval(obj *GnoEvent) bool { // Handle Attrs slice if f.Attrs != nil { + elemMatchAttrs := false for _, elem := range obj.Attrs { - if !f.Attrs.Eval(elem) { - return false + if f.Attrs.Eval(elem) { + elemMatchAttrs = true } } + + if !elemMatchAttrs { + return false + } + } return true @@ -717,21 +741,21 @@ func (f *NestedFilterEvent) Eval(obj *Event) bool { tobj := *obj if uObj, ok := tobj.(GnoEvent); ok { matchedType = true - if f.GnoEvent != nil && !f.GnoEvent.Eval(&uObj) { - return false + if f.GnoEvent != nil && f.GnoEvent.Eval(&uObj) { + return true } } if uObj, ok := tobj.(UnknownEvent); ok { matchedType = true - if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&uObj) { - return false + if f.UnknownEvent != nil && f.UnknownEvent.Eval(&uObj) { + return true } } - // If the object is of a type not specified in filters and filters are specified, ignore this element - if !matchedType { - return true + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + return false } return true @@ -1018,11 +1042,17 @@ func (f *FilterTransactionResponse) Eval(obj *TransactionResponse) bool { // Handle Events slice if f.Events != nil { + elemMatchEvents := false for _, elem := range obj.Events() { - if !f.Events.Eval(&elem) { - return false + if f.Events.Eval(&elem) { + elemMatchEvents = true } } + + if !elemMatchEvents { + return false + } + } // Handle Error field @@ -1137,11 +1167,17 @@ func (f *FilterTransaction) Eval(obj *Transaction) bool { // Handle Messages slice if f.Messages != nil { + elemMatchMessages := false for _, elem := range obj.Messages() { - if !f.Messages.Eval(elem) { - return false + if f.Messages.Eval(elem) { + elemMatchMessages = true } } + + if !elemMatchMessages { + return false + } + } // Handle Memo field @@ -1418,11 +1454,17 @@ func (f *FilterMsgCall) Eval(obj *MsgCall) bool { // Handle Args slice if f.Args != nil { + elemMatchArgs := false for _, elem := range obj.Args { - if !f.Args.Eval(&elem) { - return false + if f.Args.Eval(&elem) { + elemMatchArgs = true } } + + if !elemMatchArgs { + return false + } + } return true @@ -1525,35 +1567,35 @@ func (f *FilterMessageValue) Eval(obj *MessageValue) bool { tobj := *obj if uObj, ok := tobj.(BankMsgSend); ok { matchedType = true - if f.BankMsgSend != nil && !f.BankMsgSend.Eval(&uObj) { - return false + if f.BankMsgSend != nil && f.BankMsgSend.Eval(&uObj) { + return true } } if uObj, ok := tobj.(MsgCall); ok { matchedType = true - if f.MsgCall != nil && !f.MsgCall.Eval(&uObj) { - return false + if f.MsgCall != nil && f.MsgCall.Eval(&uObj) { + return true } } if uObj, ok := tobj.(MsgAddPackage); ok { matchedType = true - if f.MsgAddPackage != nil && !f.MsgAddPackage.Eval(&uObj) { - return false + if f.MsgAddPackage != nil && f.MsgAddPackage.Eval(&uObj) { + return true } } if uObj, ok := tobj.(MsgRun); ok { matchedType = true - if f.MsgRun != nil && !f.MsgRun.Eval(&uObj) { - return false + if f.MsgRun != nil && f.MsgRun.Eval(&uObj) { + return true } } - // If the object is of a type not specified in filters and filters are specified, ignore this element - if !matchedType { - return true + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + return false } return true @@ -1604,11 +1646,17 @@ func (f *FilterMemPackage) Eval(obj *MemPackage) bool { // Handle Files slice if f.Files != nil { + elemMatchFiles := false for _, elem := range obj.Files { - if !f.Files.Eval(elem) { - return false + if f.Files.Eval(elem) { + elemMatchFiles = true } } + + if !elemMatchFiles { + return false + } + } return true @@ -1757,11 +1805,17 @@ func (f *FilterGnoEvent) Eval(obj *GnoEvent) bool { // Handle Attrs slice if f.Attrs != nil { + elemMatchAttrs := false for _, elem := range obj.Attrs { - if !f.Attrs.Eval(elem) { - return false + if f.Attrs.Eval(elem) { + elemMatchAttrs = true } } + + if !elemMatchAttrs { + return false + } + } return true @@ -1812,21 +1866,21 @@ func (f *FilterEvent) Eval(obj *Event) bool { tobj := *obj if uObj, ok := tobj.(GnoEvent); ok { matchedType = true - if f.GnoEvent != nil && !f.GnoEvent.Eval(&uObj) { - return false + if f.GnoEvent != nil && f.GnoEvent.Eval(&uObj) { + return true } } if uObj, ok := tobj.(UnknownEvent); ok { matchedType = true - if f.UnknownEvent != nil && !f.UnknownEvent.Eval(&uObj) { - return false + if f.UnknownEvent != nil && f.UnknownEvent.Eval(&uObj) { + return true } } - // If the object is of a type not specified in filters and filters are specified, ignore this element - if !matchedType { - return true + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + return false } return true @@ -1975,11 +2029,17 @@ func (f *FilterBlock) Eval(obj *Block) bool { // Handle Txs slice if f.Txs != nil { + elemMatchTxs := false for _, elem := range obj.Txs() { - if !f.Txs.Eval(elem) { - return false + if f.Txs.Eval(elem) { + elemMatchTxs = true } } + + if !elemMatchTxs { + return false + } + } // Handle TotalTxs field diff --git a/serve/graph/playground.go b/serve/graph/playground.go new file mode 100644 index 00000000..53a426e4 --- /dev/null +++ b/serve/graph/playground.go @@ -0,0 +1,139 @@ +package graph + +import ( + "html/template" + "net/http" + "net/url" +) + +var page = template.Must(template.New("graphiql").Parse(` + + + + {{.title}} + + + + + + +
Loading...
+ + + + + + +`)) + +func HandlerWithDefaultTabs(title, endpoint string, defaultTabs []string) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Content-Type", "text/html; charset=UTF-8") + err := page.Execute(w, map[string]any{ + "title": title, + "endpoint": endpoint, + "fetcherHeaders": nil, + "uiHeaders": nil, + "defaultTabs": defaultTabs, + "endpointIsAbsolute": endpointHasScheme(endpoint), + "subscriptionEndpoint": getSubscriptionEndpoint(endpoint), + "version": "3.0.6", + "cssSRI": "sha256-wTzfn13a+pLMB5rMeysPPR1hO7x0SwSeQI+cnw7VdbE=", + "jsSRI": "sha256-eNxH+Ah7Z9up9aJYTQycgyNuy953zYZwE9Rqf5rH+r4=", + "reactSRI": "sha256-S0lp+k7zWUMk2ixteM6HZvu8L9Eh//OVrt+ZfbCpmgY=", + "reactDOMSRI": "sha256-IXWO0ITNDjfnNXIu5POVfqlgYoop36bDzhodR6LW5Pc=", + }) + if err != nil { + panic(err) + } + } +} + +// endpointHasScheme checks if the endpoint has a scheme. +func endpointHasScheme(endpoint string) bool { + u, err := url.Parse(endpoint) + return err == nil && u.Scheme != "" +} + +// getSubscriptionEndpoint returns the subscription endpoint for the given +// endpoint if it is parsable as a URL, or an empty string. +func getSubscriptionEndpoint(endpoint string) string { + u, err := url.Parse(endpoint) + if err != nil { + return "" + } + + switch u.Scheme { + case "https": + u.Scheme = "wss" + default: + u.Scheme = "ws" + } + + return u.String() +} diff --git a/serve/graph/setup.go b/serve/graph/setup.go index d7e521eb..b2184d93 100644 --- a/serve/graph/setup.go +++ b/serve/graph/setup.go @@ -2,11 +2,12 @@ package graph import ( "context" + embed "embed" + "io/fs" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/handler" "github.com/99designs/gqlgen/graphql/handler/transport" - "github.com/99designs/gqlgen/graphql/playground" "github.com/go-chi/chi/v5" "github.com/gnolang/tx-indexer/events" @@ -14,6 +15,9 @@ import ( "github.com/gnolang/tx-indexer/storage" ) +//go:embed examples/*.gql +var examples embed.FS + func Setup(s storage.Storage, manager *events.Manager, m *chi.Mux) *chi.Mux { srv := handler.NewDefaultServer(NewExecutableSchema( Config{ @@ -28,8 +32,33 @@ func Setup(s storage.Storage, manager *events.Manager, m *chi.Mux) *chi.Mux { srv.AddTransport(&transport.Websocket{}) - m.Handle("/graphql", playground.Handler("Gno Indexer: GraphQL playground", "/graphql/query")) + es, err := examplesToSlice() + if err != nil { + panic(err) + } + + m.Handle("/graphql", HandlerWithDefaultTabs("Gno Indexer: GraphQL playground", "/graphql/query", es)) m.Handle("/graphql/query", srv) return m } + +func examplesToSlice() ([]string, error) { + var out []string + err := fs.WalkDir(examples, ".", func(path string, d fs.DirEntry, err error) error { + if d.IsDir() { + return nil + } + + content, err := examples.ReadFile(path) + if err != nil { + return err + } + + out = append(out, string(content)) + + return nil + }) + + return out, err +} From ea3ed11799223da602faec4b67280b1c315a9042 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Thu, 19 Sep 2024 13:30:54 +0200 Subject: [PATCH 06/12] Add another example for blocks Signed-off-by: Antonio Navarro Perez --- serve/graph/examples/get_specific_blocks.gql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 serve/graph/examples/get_specific_blocks.gql diff --git a/serve/graph/examples/get_specific_blocks.gql b/serve/graph/examples/get_specific_blocks.gql new file mode 100644 index 00000000..695d0f20 --- /dev/null +++ b/serve/graph/examples/get_specific_blocks.gql @@ -0,0 +1,12 @@ +query getSpecificBlocksByHeight { + getBlocks(where: {_or: [{height: {gt: 1990, lt: 2000}}, {height: {eq: 200}}]}) { + hash + height + time + num_txs + total_txs + txs { + content_raw + } + } +} \ No newline at end of file From 9b4827be7afd48001d0ea770ab80174464ef0948 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Thu, 19 Sep 2024 13:38:18 +0200 Subject: [PATCH 07/12] linter Signed-off-by: Antonio Navarro Perez --- serve/graph/all.resolvers.go | 6 ++++-- serve/graph/gen/generate.go | 40 +++++++++++++++++++++++------------- serve/graph/playground.go | 9 ++++---- serve/graph/setup.go | 8 +++++++- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go index bd8f971f..0f89119b 100644 --- a/serve/graph/all.resolvers.go +++ b/serve/graph/all.resolvers.go @@ -295,5 +295,7 @@ func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } // Subscription returns SubscriptionResolver implementation. func (r *Resolver) Subscription() SubscriptionResolver { return &subscriptionResolver{r} } -type queryResolver struct{ *Resolver } -type subscriptionResolver struct{ *Resolver } +type ( + queryResolver struct{ *Resolver } + subscriptionResolver struct{ *Resolver } +) diff --git a/serve/graph/gen/generate.go b/serve/graph/gen/generate.go index b96b4570..1adbcb9b 100644 --- a/serve/graph/gen/generate.go +++ b/serve/graph/gen/generate.go @@ -1,4 +1,4 @@ -// go:build ignore +//go:build ignore package main @@ -11,41 +11,53 @@ import ( "github.com/ajnavarro/gqlfiltergen" ) -var queriesInject string = ` +var queriesInject = ` type Query { """ - Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + EXPERIMENTAL: Fetches Blocks matching the specified where criteria. + Incomplete results due to errors return both the partial Blocks and + the associated errors. """ getBlocks(where: FilterBlock!): [Block!] """ - Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. + EXPERIMENTAL: Retrieves a list of Transactions that match the given + where criteria. If the result is incomplete due to errors, both partial + results and errors are returned. """ getTransactions(where: FilterTransaction!): [Transaction!] } type Subscription { """ - Subscribes to real-time updates of Transactions that match the provided filter criteria. - This subscription starts immediately and only includes Transactions added to the blockchain after the subscription is active. + EXPERIMENTAL: Subscribes to real-time updates of Transactions that + match the provided filter criteria. This subscription starts immediately + and only includes Transactions added to the blockchain after the subscription + is active. - This is useful for applications needing to track Transactions in real-time, such as wallets tracking incoming transactions - or analytics platforms monitoring blockchain activity. + This is useful for applications needing to track Transactions in real-time, + such as wallets tracking incoming transactions or analytics platforms + monitoring blockchain activity. Returns: - - Transaction: Each received update is a Transaction object that matches the filter criteria. + - Transaction: Each received update is a Transaction object that matches + the filter criteria. """ getTransactions(filter: FilterTransaction!): Transaction! """ - Subscribes to real-time updates of Blocks that match the provided filter criteria. Similar to the Transactions subscription, - this subscription is active immediately upon creation and only includes Blocks added after the subscription begins. + EXPERIMENTAL: Subscribes to real-time updates of Blocks that match the provided + filter criteria. Similar to the Transactions subscription, + this subscription is active immediately upon creation and only includes Blocks + added after the subscription begins. - This subscription is ideal for services that need to be notified of new Blocks for processing or analysis, such as block explorers, - data aggregators, or security monitoring tools. + This subscription is ideal for services that need to be notified of new Blocks + for processing or analysis, such as block explorers, data aggregators, or security + monitoring tools. Returns: - - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. + - Block: Each update consists of a Block object that satisfies the filter criteria, + allowing subscribers to process or analyze new Blocks in real time. """ getBlocks(filter: FilterBlock!): Block! } diff --git a/serve/graph/playground.go b/serve/graph/playground.go index 53a426e4..4a4e7743 100644 --- a/serve/graph/playground.go +++ b/serve/graph/playground.go @@ -92,9 +92,10 @@ var page = template.Must(template.New("graphiql").Parse(` `)) func HandlerWithDefaultTabs(title, endpoint string, defaultTabs []string) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, _ *http.Request) { w.Header().Add("Content-Type", "text/html; charset=UTF-8") - err := page.Execute(w, map[string]any{ + + if err := page.Execute(w, map[string]any{ "title": title, "endpoint": endpoint, "fetcherHeaders": nil, @@ -107,8 +108,7 @@ func HandlerWithDefaultTabs(title, endpoint string, defaultTabs []string) http.H "jsSRI": "sha256-eNxH+Ah7Z9up9aJYTQycgyNuy953zYZwE9Rqf5rH+r4=", "reactSRI": "sha256-S0lp+k7zWUMk2ixteM6HZvu8L9Eh//OVrt+ZfbCpmgY=", "reactDOMSRI": "sha256-IXWO0ITNDjfnNXIu5POVfqlgYoop36bDzhodR6LW5Pc=", - }) - if err != nil { + }); err != nil { panic(err) } } @@ -117,6 +117,7 @@ func HandlerWithDefaultTabs(title, endpoint string, defaultTabs []string) http.H // endpointHasScheme checks if the endpoint has a scheme. func endpointHasScheme(endpoint string) bool { u, err := url.Parse(endpoint) + return err == nil && u.Scheme != "" } diff --git a/serve/graph/setup.go b/serve/graph/setup.go index b2184d93..57697c67 100644 --- a/serve/graph/setup.go +++ b/serve/graph/setup.go @@ -23,7 +23,12 @@ func Setup(s storage.Storage, manager *events.Manager, m *chi.Mux) *chi.Mux { Config{ Resolvers: NewResolver(s, manager), Directives: DirectiveRoot{ - Filterable: func(ctx context.Context, obj interface{}, next graphql.Resolver, extras []model.FilterableExtra) (res interface{}, err error) { + Filterable: func( + ctx context.Context, + _ interface{}, + next graphql.Resolver, + _ []model.FilterableExtra, + ) (interface{}, error) { return next(ctx) }, }, @@ -45,6 +50,7 @@ func Setup(s storage.Storage, manager *events.Manager, m *chi.Mux) *chi.Mux { func examplesToSlice() ([]string, error) { var out []string + err := fs.WalkDir(examples, ".", func(path string, d fs.DirEntry, err error) error { if d.IsDir() { return nil From f514f4dc3ee760359cd50e5d3abd06e8bd7031ab Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Thu, 19 Sep 2024 13:51:34 +0200 Subject: [PATCH 08/12] go generate Signed-off-by: Antonio Navarro Perez --- go.mod | 1 - go.sum | 2 -- serve/graph/all.resolvers.go | 6 ++---- serve/graph/generated.go | 36 ++++++++++++++++++++++++------------ 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 5da7bd87..419f0153 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.22.7 require ( github.com/99designs/gqlgen v0.17.54 - github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 github.com/cockroachdb/pebble v1.1.2 github.com/gnolang/gno v0.2.0 github.com/go-chi/chi/v5 v5.1.0 diff --git a/go.sum b/go.sum index 82d3397a..2c5ed20e 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,6 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 h1:P5k+90SdRIMnbLvreMZ/UmrnagcS4Sd6VdANboAG7C0= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go index 0f89119b..bd8f971f 100644 --- a/serve/graph/all.resolvers.go +++ b/serve/graph/all.resolvers.go @@ -295,7 +295,5 @@ func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } // Subscription returns SubscriptionResolver implementation. func (r *Resolver) Subscription() SubscriptionResolver { return &subscriptionResolver{r} } -type ( - queryResolver struct{ *Resolver } - subscriptionResolver struct{ *Resolver } -) +type queryResolver struct{ *Resolver } +type subscriptionResolver struct{ *Resolver } diff --git a/serve/graph/generated.go b/serve/graph/generated.go index 0513d16e..b3595a40 100644 --- a/serve/graph/generated.go +++ b/serve/graph/generated.go @@ -2665,11 +2665,15 @@ type Query { """ latestBlockHeight: Int! """ - Fetches Blocks matching the specified where criteria. Incomplete results due to errors return both the partial Blocks and the associated errors. + EXPERIMENTAL: Fetches Blocks matching the specified where criteria. + Incomplete results due to errors return both the partial Blocks and + the associated errors. """ getBlocks(where: FilterBlock!): [Block!] """ - Retrieves a list of Transactions that match the given where criteria. If the result is incomplete due to errors, both partial results and errors are returned. + EXPERIMENTAL: Retrieves a list of Transactions that match the given + where criteria. If the result is incomplete due to errors, both partial + results and errors are returned. """ getTransactions(where: FilterTransaction!): [Transaction!] } @@ -2701,25 +2705,33 @@ type Subscription { """ blocks(filter: BlockFilter!): Block! """ - Subscribes to real-time updates of Transactions that match the provided filter criteria. - This subscription starts immediately and only includes Transactions added to the blockchain after the subscription is active. + EXPERIMENTAL: Subscribes to real-time updates of Transactions that + match the provided filter criteria. This subscription starts immediately + and only includes Transactions added to the blockchain after the subscription + is active. - This is useful for applications needing to track Transactions in real-time, such as wallets tracking incoming transactions - or analytics platforms monitoring blockchain activity. + This is useful for applications needing to track Transactions in real-time, + such as wallets tracking incoming transactions or analytics platforms + monitoring blockchain activity. Returns: - - Transaction: Each received update is a Transaction object that matches the filter criteria. + - Transaction: Each received update is a Transaction object that matches + the filter criteria. """ getTransactions(filter: FilterTransaction!): Transaction! """ - Subscribes to real-time updates of Blocks that match the provided filter criteria. Similar to the Transactions subscription, - this subscription is active immediately upon creation and only includes Blocks added after the subscription begins. + EXPERIMENTAL: Subscribes to real-time updates of Blocks that match the provided + filter criteria. Similar to the Transactions subscription, + this subscription is active immediately upon creation and only includes Blocks + added after the subscription begins. - This subscription is ideal for services that need to be notified of new Blocks for processing or analysis, such as block explorers, - data aggregators, or security monitoring tools. + This subscription is ideal for services that need to be notified of new Blocks + for processing or analysis, such as block explorers, data aggregators, or security + monitoring tools. Returns: - - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. + - Block: Each update consists of a Block object that satisfies the filter criteria, + allowing subscribers to process or analyze new Blocks in real time. """ getBlocks(filter: FilterBlock!): Block! } From 26dbe393cf3d80aa7f64281d1d769a2e6abb50fc Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Thu, 19 Sep 2024 13:56:30 +0200 Subject: [PATCH 09/12] Go generate 2 Signed-off-by: Antonio Navarro Perez --- go.mod | 5 +---- go.sum | 10 ++-------- tools.go | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 419f0153..1cd9db0f 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.22.7 require ( github.com/99designs/gqlgen v0.17.54 + github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 github.com/cockroachdb/pebble v1.1.2 github.com/gnolang/gno v0.2.0 github.com/go-chi/chi/v5 v5.1.0 @@ -37,7 +38,6 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect @@ -64,11 +64,8 @@ require ( github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.11.0 // indirect github.com/rs/xid v1.5.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sosodev/duration v1.3.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/urfave/cli/v2 v2.27.4 // indirect - github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect go.etcd.io/bbolt v1.3.10 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect diff --git a/go.sum b/go.sum index 2c5ed20e..617b3717 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,8 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 h1:P5k+90SdRIMnbLvreMZ/UmrnagcS4Sd6VdANboAG7C0= +github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= @@ -62,8 +64,6 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAK github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -193,8 +193,6 @@ github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= @@ -205,12 +203,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= -github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0vy5p8= github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= -github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= -github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= diff --git a/tools.go b/tools.go index fcdeac47..fcbbf6f7 100644 --- a/tools.go +++ b/tools.go @@ -4,5 +4,5 @@ package tools import ( - _ "github.com/99designs/gqlgen" + _ "github.com/ajnavarro/gqlfiltergen" ) From 887de27e19d9e1b05295789f4ae0b7f25cf75c8d Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Fri, 20 Sep 2024 09:59:06 +0200 Subject: [PATCH 10/12] use where instead of filter in subscriptions and improve example Signed-off-by: Antonio Navarro Perez --- serve/graph/all.resolvers.go | 8 ++-- .../examples/get_all_registered_users.gql | 16 ++++++- serve/graph/gen/generate.go | 6 +-- serve/graph/generated.go | 46 +++++++++---------- 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go index bd8f971f..d81c8784 100644 --- a/serve/graph/all.resolvers.go +++ b/serve/graph/all.resolvers.go @@ -268,11 +268,11 @@ func (r *subscriptionResolver) Blocks(ctx context.Context, filter model.BlockFil } // GetTransactions is the resolver for the getTransactions field. -func (r *subscriptionResolver) GetTransactions(ctx context.Context, filter model.FilterTransaction) (<-chan *model.Transaction, error) { +func (r *subscriptionResolver) GetTransactions(ctx context.Context, where model.FilterTransaction) (<-chan *model.Transaction, error) { return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Transaction) { for _, tx := range nb.Results { transaction := model.NewTransaction(tx) - if filter.Eval(transaction) { + if where.Eval(transaction) { c <- transaction } } @@ -280,10 +280,10 @@ func (r *subscriptionResolver) GetTransactions(ctx context.Context, filter model } // GetBlocks is the resolver for the getBlocks field. -func (r *subscriptionResolver) GetBlocks(ctx context.Context, filter model.FilterBlock) (<-chan *model.Block, error) { +func (r *subscriptionResolver) GetBlocks(ctx context.Context, where model.FilterBlock) (<-chan *model.Block, error) { return handleChannel(ctx, r.manager, func(nb *types.NewBlock, c chan<- *model.Block) { block := model.NewBlock(nb.Block) - if filter.Eval(block) { + if where.Eval(block) { c <- block } }), nil diff --git a/serve/graph/examples/get_all_registered_users.gql b/serve/graph/examples/get_all_registered_users.gql index 4fdbaf99..7356f110 100644 --- a/serve/graph/examples/get_all_registered_users.gql +++ b/serve/graph/examples/get_all_registered_users.gql @@ -1,6 +1,18 @@ query getAllRegisteredUsers { - getTransactions( - where: {messages: {value: {MsgCall: {func: {eq: "Register"}, pkg_path: {eq: "gno.land/r/demo/users"}}}}} + failed: getTransactions( + where: {success: {eq: false}, messages: {value: {MsgCall: {func: {eq: "Register"}, pkg_path: {eq: "gno.land/r/demo/users"}}}}} + ) { + messages { + value { + ... on MsgCall { + caller + args + } + } + } + } + success: getTransactions( + where: {success: {eq: true}, messages: {value: {MsgCall: {func: {eq: "Register"}, pkg_path: {eq: "gno.land/r/demo/users"}}}}} ) { messages { value { diff --git a/serve/graph/gen/generate.go b/serve/graph/gen/generate.go index 1adbcb9b..7764204a 100644 --- a/serve/graph/gen/generate.go +++ b/serve/graph/gen/generate.go @@ -41,9 +41,9 @@ type Subscription { Returns: - Transaction: Each received update is a Transaction object that matches - the filter criteria. + the where criteria. """ - getTransactions(filter: FilterTransaction!): Transaction! + getTransactions(where: FilterTransaction!): Transaction! """ EXPERIMENTAL: Subscribes to real-time updates of Blocks that match the provided @@ -59,7 +59,7 @@ type Subscription { - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. """ - getBlocks(filter: FilterBlock!): Block! + getBlocks(where: FilterBlock!): Block! } ` diff --git a/serve/graph/generated.go b/serve/graph/generated.go index b3595a40..5e28749a 100644 --- a/serve/graph/generated.go +++ b/serve/graph/generated.go @@ -140,8 +140,8 @@ type ComplexityRoot struct { Subscription struct { Blocks func(childComplexity int, filter model.BlockFilter) int - GetBlocks func(childComplexity int, filter model.FilterBlock) int - GetTransactions func(childComplexity int, filter model.FilterTransaction) int + GetBlocks func(childComplexity int, where model.FilterBlock) int + GetTransactions func(childComplexity int, where model.FilterTransaction) int Transactions func(childComplexity int, filter model.TransactionFilter) int } @@ -197,8 +197,8 @@ type QueryResolver interface { type SubscriptionResolver interface { Transactions(ctx context.Context, filter model.TransactionFilter) (<-chan *model.Transaction, error) Blocks(ctx context.Context, filter model.BlockFilter) (<-chan *model.Block, error) - GetTransactions(ctx context.Context, filter model.FilterTransaction) (<-chan *model.Transaction, error) - GetBlocks(ctx context.Context, filter model.FilterBlock) (<-chan *model.Block, error) + GetTransactions(ctx context.Context, where model.FilterTransaction) (<-chan *model.Transaction, error) + GetBlocks(ctx context.Context, where model.FilterBlock) (<-chan *model.Block, error) } type executableSchema struct { @@ -633,7 +633,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Subscription.GetBlocks(childComplexity, args["filter"].(model.FilterBlock)), true + return e.complexity.Subscription.GetBlocks(childComplexity, args["where"].(model.FilterBlock)), true case "Subscription.getTransactions": if e.complexity.Subscription.GetTransactions == nil { @@ -645,7 +645,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Subscription.GetTransactions(childComplexity, args["filter"].(model.FilterTransaction)), true + return e.complexity.Subscription.GetTransactions(childComplexity, args["where"].(model.FilterTransaction)), true case "Subscription.transactions": if e.complexity.Subscription.Transactions == nil { @@ -2716,9 +2716,9 @@ type Subscription { Returns: - Transaction: Each received update is a Transaction object that matches - the filter criteria. + the where criteria. """ - getTransactions(filter: FilterTransaction!): Transaction! + getTransactions(where: FilterTransaction!): Transaction! """ EXPERIMENTAL: Subscribes to real-time updates of Blocks that match the provided filter criteria. Similar to the Transactions subscription, @@ -2733,7 +2733,7 @@ type Subscription { - Block: Each update consists of a Block object that satisfies the filter criteria, allowing subscribers to process or analyze new Blocks in real time. """ - getBlocks(filter: FilterBlock!): Block! + getBlocks(where: FilterBlock!): Block! } """ Field representing a point on time. It is following the RFC3339Nano format ("2006-01-02T15:04:05.999999999Z07:00") @@ -3216,28 +3216,28 @@ func (ec *executionContext) field_Subscription_blocks_argsFilter( func (ec *executionContext) field_Subscription_getBlocks_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - arg0, err := ec.field_Subscription_getBlocks_argsFilter(ctx, rawArgs) + arg0, err := ec.field_Subscription_getBlocks_argsWhere(ctx, rawArgs) if err != nil { return nil, err } - args["filter"] = arg0 + args["where"] = arg0 return args, nil } -func (ec *executionContext) field_Subscription_getBlocks_argsFilter( +func (ec *executionContext) field_Subscription_getBlocks_argsWhere( ctx context.Context, rawArgs map[string]interface{}, ) (model.FilterBlock, error) { // We won't call the directive if the argument is null. // Set call_argument_directives_with_null to true to call directives // even if the argument is null. - _, ok := rawArgs["filter"] + _, ok := rawArgs["where"] if !ok { var zeroVal model.FilterBlock return zeroVal, nil } - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - if tmp, ok := rawArgs["filter"]; ok { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + if tmp, ok := rawArgs["where"]; ok { return ec.unmarshalNFilterBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx, tmp) } @@ -3248,28 +3248,28 @@ func (ec *executionContext) field_Subscription_getBlocks_argsFilter( func (ec *executionContext) field_Subscription_getTransactions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - arg0, err := ec.field_Subscription_getTransactions_argsFilter(ctx, rawArgs) + arg0, err := ec.field_Subscription_getTransactions_argsWhere(ctx, rawArgs) if err != nil { return nil, err } - args["filter"] = arg0 + args["where"] = arg0 return args, nil } -func (ec *executionContext) field_Subscription_getTransactions_argsFilter( +func (ec *executionContext) field_Subscription_getTransactions_argsWhere( ctx context.Context, rawArgs map[string]interface{}, ) (model.FilterTransaction, error) { // We won't call the directive if the argument is null. // Set call_argument_directives_with_null to true to call directives // even if the argument is null. - _, ok := rawArgs["filter"] + _, ok := rawArgs["where"] if !ok { var zeroVal model.FilterTransaction return zeroVal, nil } - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - if tmp, ok := rawArgs["filter"]; ok { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("where")) + if tmp, ok := rawArgs["where"]; ok { return ec.unmarshalNFilterTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransaction(ctx, tmp) } @@ -7280,7 +7280,7 @@ func (ec *executionContext) _Subscription_getTransactions(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Subscription().GetTransactions(rctx, fc.Args["filter"].(model.FilterTransaction)) + return ec.resolvers.Subscription().GetTransactions(rctx, fc.Args["where"].(model.FilterTransaction)) }) if err != nil { ec.Error(ctx, err) @@ -7373,7 +7373,7 @@ func (ec *executionContext) _Subscription_getBlocks(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Subscription().GetBlocks(rctx, fc.Args["filter"].(model.FilterBlock)) + return ec.resolvers.Subscription().GetBlocks(rctx, fc.Args["where"].(model.FilterBlock)) }) if err != nil { ec.Error(ctx, err) From d1dce71e96ee8d48229b68adbe4515ddd205c7a0 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Fri, 20 Sep 2024 13:15:42 +0200 Subject: [PATCH 11/12] Use final version for the filter plugin Signed-off-by: Antonio Navarro Perez --- go.mod | 2 +- go.sum | 4 +- serve/graph/generated.go | 50 ++----------------------- serve/graph/model/filter_methods_gen.go | 22 +++-------- serve/graph/model/models_gen.go | 8 ---- 5 files changed, 11 insertions(+), 75 deletions(-) diff --git a/go.mod b/go.mod index 1cd9db0f..f3e4a21c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.7 require ( github.com/99designs/gqlgen v0.17.54 - github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 + github.com/ajnavarro/gqlfiltergen v0.1.0 github.com/cockroachdb/pebble v1.1.2 github.com/gnolang/gno v0.2.0 github.com/go-chi/chi/v5 v5.1.0 diff --git a/go.sum b/go.sum index 617b3717..49bc6490 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRB github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28 h1:P5k+90SdRIMnbLvreMZ/UmrnagcS4Sd6VdANboAG7C0= -github.com/ajnavarro/gqlfiltergen v0.0.0-20240918155639-e541e088cd28/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= +github.com/ajnavarro/gqlfiltergen v0.1.0 h1:Si3rIfBNQe1mFVWVFRySHDmVhprbhH7t1SyFGrEpRz4= +github.com/ajnavarro/gqlfiltergen v0.1.0/go.mod h1:uHvKxvSISkr7QFZnYlrXfpnEDI/UPpodVM/a/XkOjtU= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= diff --git a/serve/graph/generated.go b/serve/graph/generated.go index 5e28749a..90a897d1 100644 --- a/serve/graph/generated.go +++ b/serve/graph/generated.go @@ -1498,10 +1498,6 @@ input FilterInt { """ eq: Int """ - Filter a number field checking if it is NOT equals to the specified value. - """ - neq: Int - """ Filter a number field checking if it is greater than the specified value. """ gt: Int @@ -1705,17 +1701,9 @@ input FilterString { """ eq: String """ - Filter a string field checking if it is NOT equals to the specified value. - """ - neq: String - """ Filter a string field checking if it is like the specified value. You can use standard Go RegEx expressions here. """ like: String - """ - Filter a string field checking if it is NOT like the specified value. You can use standard Go RegEx expressions here. - """ - nlike: String } """ Filter type for time fields. All added filters here are processed as AND operators. @@ -1730,10 +1718,6 @@ input FilterTime { """ eq: Time """ - Filter a time field checking if it is NOT equals to the specified value. - """ - neq: Time - """ Filter a time field checking if it is before than the specified value. """ before: Time @@ -11518,7 +11502,7 @@ func (ec *executionContext) unmarshalInputFilterInt(ctx context.Context, obj int asMap[k] = v } - fieldsInOrder := [...]string{"exists", "eq", "neq", "gt", "lt"} + fieldsInOrder := [...]string{"exists", "eq", "gt", "lt"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -11539,13 +11523,6 @@ func (ec *executionContext) unmarshalInputFilterInt(ctx context.Context, obj int return it, err } it.Eq = data - case "neq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - it.Neq = data case "gt": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gt")) data, err := ec.unmarshalOInt2ᚖint(ctx, v) @@ -11959,7 +11936,7 @@ func (ec *executionContext) unmarshalInputFilterString(ctx context.Context, obj asMap[k] = v } - fieldsInOrder := [...]string{"exists", "eq", "neq", "like", "nlike"} + fieldsInOrder := [...]string{"exists", "eq", "like"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -11980,13 +11957,6 @@ func (ec *executionContext) unmarshalInputFilterString(ctx context.Context, obj return it, err } it.Eq = data - case "neq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.Neq = data case "like": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("like")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) @@ -11994,13 +11964,6 @@ func (ec *executionContext) unmarshalInputFilterString(ctx context.Context, obj return it, err } it.Like = data - case "nlike": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nlike")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.Nlike = data } } @@ -12014,7 +11977,7 @@ func (ec *executionContext) unmarshalInputFilterTime(ctx context.Context, obj in asMap[k] = v } - fieldsInOrder := [...]string{"exists", "eq", "neq", "before", "after"} + fieldsInOrder := [...]string{"exists", "eq", "before", "after"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -12035,13 +11998,6 @@ func (ec *executionContext) unmarshalInputFilterTime(ctx context.Context, obj in return it, err } it.Eq = data - case "neq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("neq")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) - if err != nil { - return it, err - } - it.Neq = data case "before": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) diff --git a/serve/graph/model/filter_methods_gen.go b/serve/graph/model/filter_methods_gen.go index 2876d976..9f1b2131 100644 --- a/serve/graph/model/filter_methods_gen.go +++ b/serve/graph/model/filter_methods_gen.go @@ -2287,7 +2287,7 @@ func (f *FilterBoolean) Eval(val *bool) bool { return true } - return rootEval(val, f.Exists, f.Eq, nil) + return rootEval(val, f.Exists, f.Eq) } func (f *FilterInt) Eval(val *int) bool { @@ -2295,7 +2295,7 @@ func (f *FilterInt) Eval(val *int) bool { return true } - if !rootEval(val, f.Exists, f.Eq, f.Neq) { + if !rootEval(val, f.Exists, f.Eq) { return false } @@ -2315,7 +2315,7 @@ func (f *FilterString) Eval(val *string) bool { return true } - if !rootEval(val, f.Exists, f.Eq, f.Neq) { + if !rootEval(val, f.Exists, f.Eq) { return false } @@ -2326,13 +2326,6 @@ func (f *FilterString) Eval(val *string) bool { } } - if val != nil && f.Nlike != nil { - matched, err := regexp.MatchString(*f.Nlike, *val) - if err != nil || matched { - return false - } - } - return true } @@ -2342,7 +2335,7 @@ func (f *FilterTime) Eval(val *time.Time) bool { return true } - if !rootEval(val, f.Exists, f.Eq, f.Neq) { + if !rootEval(val, f.Exists, f.Eq) { return false } @@ -2360,7 +2353,7 @@ func (f *FilterTime) Eval(val *time.Time) bool { } // rootEval is a generic function that checks if the provided value matches the filter conditions. -func rootEval[T comparable](val *T, exists *bool, eq *T, neq *T) bool { +func rootEval[T comparable](val *T, exists *bool, eq *T) bool { // Check the Exists filter if exists != nil { if *exists && val == nil { @@ -2381,10 +2374,5 @@ func rootEval[T comparable](val *T, exists *bool, eq *T, neq *T) bool { return false } - // Check the Neq filter - if neq != nil && *neq == *val { - return false - } - return true } diff --git a/serve/graph/model/models_gen.go b/serve/graph/model/models_gen.go index 568ba420..66e24e1b 100644 --- a/serve/graph/model/models_gen.go +++ b/serve/graph/model/models_gen.go @@ -267,8 +267,6 @@ type FilterInt struct { Exists *bool `json:"exists,omitempty"` // Filter a number field checking if it is equals to the specified value. Eq *int `json:"eq,omitempty"` - // Filter a number field checking if it is NOT equals to the specified value. - Neq *int `json:"neq,omitempty"` // Filter a number field checking if it is greater than the specified value. Gt *int `json:"gt,omitempty"` // Filter a number field checking if it is less than the specified value. @@ -381,12 +379,8 @@ type FilterString struct { Exists *bool `json:"exists,omitempty"` // Filter a string field checking if it is equals to the specified value. Eq *string `json:"eq,omitempty"` - // Filter a string field checking if it is NOT equals to the specified value. - Neq *string `json:"neq,omitempty"` // Filter a string field checking if it is like the specified value. You can use standard Go RegEx expressions here. Like *string `json:"like,omitempty"` - // Filter a string field checking if it is NOT like the specified value. You can use standard Go RegEx expressions here. - Nlike *string `json:"nlike,omitempty"` } // Filter type for time fields. All added filters here are processed as AND operators. @@ -395,8 +389,6 @@ type FilterTime struct { Exists *bool `json:"exists,omitempty"` // Filter a time field checking if it is equals to the specified value. Eq *time.Time `json:"eq,omitempty"` - // Filter a time field checking if it is NOT equals to the specified value. - Neq *time.Time `json:"neq,omitempty"` // Filter a time field checking if it is before than the specified value. Before *time.Time `json:"before,omitempty"` // Filter a time field checking if it is after the specified value. From 662a97969449031c6b37cdb29158b1d1ac387fb1 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Date: Thu, 26 Sep 2024 10:59:01 +0200 Subject: [PATCH 12/12] Go generate with new gqlgen version Signed-off-by: Antonio Navarro --- serve/graph/all.resolvers.go | 2 +- serve/graph/generated.go | 2297 ++-------------------------------- 2 files changed, 99 insertions(+), 2200 deletions(-) diff --git a/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go index d81c8784..b0cdb5e1 100644 --- a/serve/graph/all.resolvers.go +++ b/serve/graph/all.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.51 +// Code generated by github.com/99designs/gqlgen version v0.17.54 import ( "context" diff --git a/serve/graph/generated.go b/serve/graph/generated.go index 90a897d1..46f0fe47 100644 --- a/serve/graph/generated.go +++ b/serve/graph/generated.go @@ -13803,27 +13803,15 @@ func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, ob case nil: return graphql.Null case model.GnoEvent: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "GnoEvent"})) == 0 { - return graphql.Empty{} - } return ec._GnoEvent(ctx, sel, &obj) case *model.GnoEvent: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "GnoEvent"})) == 0 { - return graphql.Empty{} - } if obj == nil { return graphql.Null } return ec._GnoEvent(ctx, sel, obj) case model.UnknownEvent: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "UnknownEvent"})) == 0 { - return graphql.Empty{} - } return ec._UnknownEvent(ctx, sel, &obj) case *model.UnknownEvent: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Event", "UnknownEvent"})) == 0 { - return graphql.Empty{} - } if obj == nil { return graphql.Null } @@ -13838,66 +13826,36 @@ func (ec *executionContext) _MessageValue(ctx context.Context, sel ast.Selection case nil: return graphql.Null case model.BankMsgSend: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "BankMsgSend"})) == 0 { - return graphql.Empty{} - } return ec._BankMsgSend(ctx, sel, &obj) case *model.BankMsgSend: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "BankMsgSend"})) == 0 { - return graphql.Empty{} - } if obj == nil { return graphql.Null } return ec._BankMsgSend(ctx, sel, obj) case model.MsgCall: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgCall"})) == 0 { - return graphql.Empty{} - } return ec._MsgCall(ctx, sel, &obj) case *model.MsgCall: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgCall"})) == 0 { - return graphql.Empty{} - } if obj == nil { return graphql.Null } return ec._MsgCall(ctx, sel, obj) case model.MsgAddPackage: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgAddPackage"})) == 0 { - return graphql.Empty{} - } return ec._MsgAddPackage(ctx, sel, &obj) case *model.MsgAddPackage: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgAddPackage"})) == 0 { - return graphql.Empty{} - } if obj == nil { return graphql.Null } return ec._MsgAddPackage(ctx, sel, obj) case model.MsgRun: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgRun"})) == 0 { - return graphql.Empty{} - } return ec._MsgRun(ctx, sel, &obj) case *model.MsgRun: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "MsgRun"})) == 0 { - return graphql.Empty{} - } if obj == nil { return graphql.Null } return ec._MsgRun(ctx, sel, obj) case model.UnexpectedMessage: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "UnexpectedMessage"})) == 0 { - return graphql.Empty{} - } return ec._UnexpectedMessage(ctx, sel, &obj) case *model.UnexpectedMessage: - if len(graphql.CollectFields(ec.OperationContext, sel, []string{"MessageValue", "UnexpectedMessage"})) == 0 { - return graphql.Empty{} - } if obj == nil { return graphql.Null } @@ -13923,76 +13881,16 @@ func (ec *executionContext) _BankMsgSend(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("BankMsgSend") case "from_address": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._BankMsgSend_from_address(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._BankMsgSend_from_address(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "to_address": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._BankMsgSend_to_address(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._BankMsgSend_to_address(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "amount": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._BankMsgSend_amount(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._BankMsgSend_amount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14032,426 +13930,86 @@ func (ec *executionContext) _Block(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Block") case "hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "height": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_height(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_height(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "version": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_version(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_version(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "chain_id": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_chain_id(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_chain_id(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "time": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_time(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_time(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "num_txs": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_num_txs(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_num_txs(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "total_txs": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_total_txs(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_total_txs(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "app_version": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_app_version(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_app_version(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "last_block_hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_last_block_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_last_block_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "last_commit_hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_last_commit_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_last_commit_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "validators_hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_validators_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_validators_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "next_validators_hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_next_validators_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_next_validators_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "consensus_hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_consensus_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_consensus_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "app_hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_app_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_app_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "last_results_hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_last_results_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_last_results_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "proposer_address_raw": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_proposer_address_raw(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_proposer_address_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "txs": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Block_txs(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Block_txs(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14491,101 +14049,21 @@ func (ec *executionContext) _BlockTransaction(ctx context.Context, sel ast.Selec case "__typename": out.Values[i] = graphql.MarshalString("BlockTransaction") case "hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._BlockTransaction_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._BlockTransaction_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "fee": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._BlockTransaction_fee(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._BlockTransaction_fee(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "memo": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._BlockTransaction_memo(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._BlockTransaction_memo(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "content_raw": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._BlockTransaction_content_raw(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._BlockTransaction_content_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14625,51 +14103,11 @@ func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Coin") case "amount": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Coin_amount(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Coin_amount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "denom": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Coin_denom(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Coin_denom(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14709,101 +14147,21 @@ func (ec *executionContext) _GnoEvent(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("GnoEvent") case "type": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._GnoEvent_type(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._GnoEvent_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "pkg_path": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._GnoEvent_pkg_path(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._GnoEvent_pkg_path(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "func": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._GnoEvent_func(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._GnoEvent_func(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "attrs": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._GnoEvent_attrs(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._GnoEvent_attrs(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -14840,51 +14198,11 @@ func (ec *executionContext) _GnoEventAttribute(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("GnoEventAttribute") case "key": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._GnoEventAttribute_key(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._GnoEventAttribute_key(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "value": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._GnoEventAttribute_value(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._GnoEventAttribute_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -14924,51 +14242,11 @@ func (ec *executionContext) _MemFile(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("MemFile") case "name": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MemFile_name(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MemFile_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "body": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MemFile_body(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MemFile_body(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -15008,76 +14286,16 @@ func (ec *executionContext) _MemPackage(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("MemPackage") case "name": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MemPackage_name(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MemPackage_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "path": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MemPackage_path(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MemPackage_path(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "files": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MemPackage_files(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MemPackage_files(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15114,76 +14332,16 @@ func (ec *executionContext) _MsgAddPackage(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("MsgAddPackage") case "creator": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgAddPackage_creator(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgAddPackage_creator(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "package": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgAddPackage_package(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgAddPackage_package(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deposit": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgAddPackage_deposit(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgAddPackage_deposit(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -15223,126 +14381,26 @@ func (ec *executionContext) _MsgCall(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("MsgCall") case "caller": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgCall_caller(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgCall_caller(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "send": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgCall_send(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgCall_send(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "pkg_path": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgCall_pkg_path(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgCall_pkg_path(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "func": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgCall_func(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgCall_func(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "args": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgCall_args(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgCall_args(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15379,76 +14437,16 @@ func (ec *executionContext) _MsgRun(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("MsgRun") case "caller": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgRun_caller(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgRun_caller(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "send": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgRun_send(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgRun_send(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "package": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._MsgRun_package(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._MsgRun_package(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -15498,45 +14496,106 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "transactions": field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query_transactions(ctx, field) - }) + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_transactions(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "blocks": field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query_blocks(ctx, field) - }) + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_blocks(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "latestBlockHeight": field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query_latestBlockHeight(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_latestBlockHeight(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "getBlocks": field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query_getBlocks(ctx, field) - }) + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_getBlocks(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "getTransactions": field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query_getTransactions(ctx, field) - }) - case "__type": - field := field + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_getTransactions(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___type(ctx, field) }) case "__schema": - field := field - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___schema(ctx, field) }) @@ -15601,273 +14660,53 @@ func (ec *executionContext) _Transaction(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("Transaction") case "index": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_index(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_index(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "hash": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_hash(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "success": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_success(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_success(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "block_height": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_block_height(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_block_height(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_wanted": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_gas_wanted(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_gas_wanted(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_used": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_gas_used(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_gas_used(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_fee": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_gas_fee(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_gas_fee(ctx, field, obj) case "content_raw": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_content_raw(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_content_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "messages": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_messages(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_messages(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "memo": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_memo(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_memo(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "response": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._Transaction_response(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._Transaction_response(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -15907,76 +14746,16 @@ func (ec *executionContext) _TransactionMessage(ctx context.Context, sel ast.Sel case "__typename": out.Values[i] = graphql.MarshalString("TransactionMessage") case "typeUrl": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionMessage_typeUrl(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionMessage_typeUrl(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "route": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionMessage_route(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionMessage_route(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "value": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionMessage_value(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionMessage_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -16016,126 +14795,26 @@ func (ec *executionContext) _TransactionResponse(ctx context.Context, sel ast.Se case "__typename": out.Values[i] = graphql.MarshalString("TransactionResponse") case "log": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionResponse_log(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionResponse_log(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "info": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionResponse_info(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionResponse_info(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "error": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionResponse_error(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionResponse_error(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "data": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionResponse_data(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionResponse_data(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "events": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TransactionResponse_events(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TransactionResponse_events(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -16172,51 +14851,11 @@ func (ec *executionContext) _TxFee(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("TxFee") case "gas_wanted": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TxFee_gas_wanted(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TxFee_gas_wanted(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "gas_fee": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._TxFee_gas_fee(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._TxFee_gas_fee(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -16256,26 +14895,6 @@ func (ec *executionContext) _UnexpectedMessage(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("UnexpectedMessage") case "raw": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._UnexpectedMessage_raw(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._UnexpectedMessage_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -16315,26 +14934,6 @@ func (ec *executionContext) _UnknownEvent(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("UnknownEvent") case "value": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._UnknownEvent_value(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec._UnknownEvent_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -16374,123 +14973,23 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Directive_name(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Directive_description(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Directive_locations(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "args": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Directive_args(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isRepeatable": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Directive_isRepeatable(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -16530,98 +15029,18 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___EnumValue_name(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___EnumValue_description(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -16658,148 +15077,28 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Field_name(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Field_description(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Field_args(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "type": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Field_type(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isDeprecated": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Field_isDeprecated(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Field_deprecationReason(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -16836,98 +15135,18 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___InputValue_name(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___InputValue_description(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___InputValue_type(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "defaultValue": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___InputValue_defaultValue(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -16964,142 +15183,22 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Schema_description(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Schema_types(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "queryType": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Schema_queryType(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "mutationType": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Schema_mutationType(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Schema_subscriptionType(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Schema_directives(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -17139,227 +15238,27 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_kind(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "name": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_name(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_description(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_fields(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_interfaces(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_possibleTypes(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_enumValues(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_inputFields(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_ofType(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - field := field - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec.___Type_specifiedByURL(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -17410,7 +15309,7 @@ func (ec *executionContext) unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑ func (ec *executionContext) marshalNBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx context.Context, sel ast.SelectionSet, v []*model.BlockTransaction) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -17622,7 +15521,7 @@ func (ec *executionContext) unmarshalNTransactionFilter2githubᚗcomᚋgnolang func (ec *executionContext) marshalNTransactionMessage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessage(ctx context.Context, sel ast.SelectionSet, v []*model.TransactionMessage) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -17689,7 +15588,7 @@ func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -17765,7 +15664,7 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -17821,7 +15720,7 @@ func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlg func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -17869,7 +15768,7 @@ func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋg func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -17957,7 +15856,7 @@ func (ec *executionContext) marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑin } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -18051,7 +15950,7 @@ func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindex } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -18688,7 +16587,7 @@ func (ec *executionContext) marshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋ } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -18735,7 +16634,7 @@ func (ec *executionContext) marshalOGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnola } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -18798,7 +16697,7 @@ func (ec *executionContext) marshalOMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑ } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -19455,7 +17354,7 @@ func (ec *executionContext) marshalOTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋt } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -19545,7 +17444,7 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgq } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -19592,7 +17491,7 @@ func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -19639,7 +17538,7 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋg } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) } @@ -19693,7 +17592,7 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := true + isLen1 := len(v) == 1 if !isLen1 { wg.Add(len(v)) }