diff --git a/go.mod b/go.mod index 4f86a327..93c047dc 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.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 @@ -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 fb6f30b4..a171a685 100644 --- a/go.sum +++ b/go.sum @@ -4,17 +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.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/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= @@ -66,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= @@ -197,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= @@ -209,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/serve/graph/all.resolvers.go b/serve/graph/all.resolvers.go new file mode 100644 index 00000000..b0cdb5e1 --- /dev/null +++ b/serve/graph/all.resolvers.go @@ -0,0 +1,299 @@ +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.54 + +import ( + "context" + + "github.com/99designs/gqlgen/graphql" + "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. +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 != nil && + 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 +} + +// GetTransactions is the resolver for the getTransactions field. +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 where.Eval(transaction) { + c <- transaction + } + } + }), nil +} + +// GetBlocks is the resolver for the getBlocks field. +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 where.Eval(block) { + 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/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..7356f110 --- /dev/null +++ b/serve/graph/examples/get_all_registered_users.gql @@ -0,0 +1,26 @@ +query getAllRegisteredUsers { + 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 { + ... on MsgCall { + caller + args + } + } + } + } +} \ No newline at end of file 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 diff --git a/serve/graph/gen/generate.go b/serve/graph/gen/generate.go new file mode 100644 index 00000000..7764204a --- /dev/null +++ b/serve/graph/gen/generate.go @@ -0,0 +1,82 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + + "github.com/99designs/gqlgen/api" + "github.com/99designs/gqlgen/codegen/config" + "github.com/ajnavarro/gqlfiltergen" +) + +var queriesInject = ` +type Query { + """ + 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!] + + """ + 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 { + """ + 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. + + Returns: + - Transaction: Each received update is a Transaction object that matches + the where criteria. + """ + getTransactions(where: FilterTransaction!): Transaction! + + """ + 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. + + 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(where: FilterBlock!): Block! +} +` + +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{ + InjectCodeAfter: queriesInject, + })), + ) + 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..46f0fe47 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.FilterableExtra) (res interface{}, err error) } type ComplexityRoot struct { @@ -132,13 +132,17 @@ 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 } 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, where model.FilterBlock) int + GetTransactions func(childComplexity int, where model.FilterTransaction) int + Transactions func(childComplexity int, filter model.TransactionFilter) int } Transaction struct { @@ -187,10 +191,14 @@ 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) Blocks(ctx context.Context, filter model.BlockFilter) (<-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 { @@ -560,6 +568,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 @@ -591,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["where"].(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["where"].(model.FilterTransaction)), true + case "Subscription.transactions": if e.complexity.Subscription.Transactions == nil { break @@ -777,11 +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.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, @@ -884,25 +978,1994 @@ 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: [FilterableExtra!] +) 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! @filterable + """ + the bech32 address of the fund receiver. + ex) ` + "`" + `g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5` + "`" + ` + """ + to_address: String! @filterable + """ + the denomination and amount of fund sent (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + amount: String! @filterable +} +""" +` + "`" + `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 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 { + """ + 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: FilterInt + """ + 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: FilterInt + """ + filter for total_txs field. + """ + total_txs: FilterInt + """ + 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: 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 FilterInt { + """ + 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 greater than the specified value. + """ + gt: Int + """ + Filter a number field checking if it is less than the specified value. + """ + 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 { + """ + 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 like the specified value. You can use standard Go RegEx expressions here. + """ + like: 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 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: FilterInt + """ + filter for hash field. + """ + hash: FilterString + """ + filter for success field. + """ + success: FilterBoolean + """ + filter for block_height field. + """ + block_height: FilterInt + """ + filter for gas_wanted field. + """ + gas_wanted: FilterInt + """ + filter for gas_used field. + """ + gas_used: FilterInt + """ + 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 value field. + """ + value: NestedFilterMessageValue +} +""" +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 events field. + """ + events: NestedFilterEvent +} +""" +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: FilterInt + """ + filter for gas_fee field. + """ + gas_fee: NestedFilterCoin +} +""" +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. + """ + 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! @filterable + """ + ` + "`" + `pkg_path` + "`" + ` is the path to the package that emitted the event. + """ + pkg_path: String! @filterable + """ + ` + "`" + `func` + "`" + ` is the name of the function that emitted the event. + """ + func: String! @filterable + """ + ` + "`" + `attrs` + "`" + ` is the event's attribute information. + """ + attrs: [GnoEventAttribute!] @filterable +} +""" +` + "`" + `GnoEventAttribute` + "`" + ` is the attributes that the event has. +It has ` + "`" + `key` + "`" + ` and ` + "`" + `value` + "`" + `. +""" +type GnoEventAttribute { + """ + The key of the event attribute. + """ + key: String! @filterable + """ + The value of the event attribute. + """ + value: String! @filterable +} +""" +` + "`" + `MemFile` + "`" + ` is the metadata information tied to a single gno package / realm file +""" +type MemFile { + """ + the name of the source file. + """ + name: String! @filterable + """ + the content of the source file. + """ + body: String! @filterable +} +""" +` + "`" + `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! @filterable + """ + the gno path of the package. + """ + path: String! @filterable + """ + the associated package gno source. + """ + files: [MemFile!] @filterable +} +""" +` + "`" + `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! @filterable + """ + the package being deployed. + """ + package: MemPackage! @filterable + """ + the amount of funds to be deposited at deployment, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + deposit: String! @filterable +} +""" +` + "`" + `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! @filterable + """ + the amount of funds to be deposited to the package, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + send: String! @filterable + """ + the gno package path. + """ + pkg_path: String! @filterable + """ + the function name being invoked. + """ + func: String! @filterable + """ + ` + "`" + `args` + "`" + ` are the arguments passed to the executed function. + """ + args: [String!] @filterable +} +""" +` + "`" + `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! @filterable + """ + the amount of funds to be deposited to the package, if any (""). + ex) ` + "`" + `1000000ugnot` + "`" + ` + """ + send: String! @filterable + """ + the package being executed. + """ + package: MemPackage! @filterable +} +""" +` + "`" + `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 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 { + """ + 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: FilterInt + """ + filter for denom field. + """ + denom: FilterString +} +""" +filter for Event objects +""" +input NestedFilterEvent { + """ + logical operator for Event that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterEvent] + """ + logical operator for Event that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterEvent] + """ + logical operator for Event that will reverse conditions. + """ + _not: NestedFilterEvent + """ + filter for GnoEvent union type. + """ + GnoEvent: NestedFilterGnoEvent + """ + filter for UnknownEvent union type. + """ + UnknownEvent: NestedFilterUnknownEvent +} +""" +filter for GnoEvent objects +""" +input NestedFilterGnoEvent { + """ + logical operator for GnoEvent that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterGnoEvent] + """ + logical operator for GnoEvent that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterGnoEvent] + """ + logical operator for GnoEvent that will reverse conditions. + """ + _not: NestedFilterGnoEvent + """ + 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 NestedFilterGnoEventAttribute { + """ + logical operator for GnoEventAttribute that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterGnoEventAttribute] + """ + logical operator for GnoEventAttribute that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterGnoEventAttribute] + """ + logical operator for GnoEventAttribute that will reverse conditions. + """ + _not: NestedFilterGnoEventAttribute + """ + filter for key field. + """ + key: FilterString + """ + filter for value field. + """ + value: FilterString +} +""" +filter for MemFile objects +""" +input NestedFilterMemFile { + """ + logical operator for MemFile that will combine two or more conditions, returning true if all of them are true. + """ + _and: [NestedFilterMemFile] + """ + logical operator for MemFile that will combine two or more conditions, returning true if at least one of them is true. + """ + _or: [NestedFilterMemFile] + """ + logical operator for MemFile that will reverse conditions. + """ + _not: NestedFilterMemFile + """ + filter for name field. + """ + name: FilterString + """ + filter for body field. + """ + body: FilterString +} +""" +filter for MemPackage objects +""" +input NestedFilterMemPackage { + """ + 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! + """ + 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!] + """ + 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!] +} +""" +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! + """ + 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. + + Returns: + - Transaction: Each received update is a Transaction object that matches + the where criteria. + """ + getTransactions(where: FilterTransaction!): Transaction! + """ + 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. + + 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(where: FilterBlock!): 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 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]` + "`" + ` + """ + message: [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! @filterable +} +""" +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] @filterable +} +""" +` + "`" + `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! @filterable +} +`, BuiltIn: false}, } var parsedSchema = gqlparser.MustLoadSchema(sources...) @@ -910,110 +2973,389 @@ 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{}{} + 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{}{} + 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{}{} + 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{}{} + arg0, err := ec.field_Subscription_getBlocks_argsWhere(ctx, rawArgs) + if err != nil { + return nil, err + } + args["where"] = arg0 + return args, nil +} +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["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_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_argsWhere(ctx, rawArgs) + if err != nil { + return nil, err + } + args["where"] = arg0 + return args, nil +} +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["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_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 ***************************** @@ -1036,8 +3378,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -1054,7 +3418,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, @@ -1080,8 +3444,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -1098,7 +3484,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, @@ -1124,8 +3510,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -1142,7 +3550,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 +3576,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +3616,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 +3642,35 @@ 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.unmarshalOFilterableExtra2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtraᚄ(ctx, []interface{}{"MINMAX"}) + if err != nil { + var zeroVal int64 + return zeroVal, err + } + if ec.directives.Filterable == nil { + var zeroVal int64 + return zeroVal, 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 +3687,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 +3713,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +3753,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 +3779,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +3819,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 +3845,30 @@ 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 { + var zeroVal time.Time + return zeroVal, 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 +3885,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 +3911,30 @@ 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 { + var zeroVal int64 + return zeroVal, 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 +3951,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 +3977,30 @@ 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 { + var zeroVal int64 + return zeroVal, 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 +4017,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 +4043,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4083,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 +4109,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4149,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 +4175,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4215,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 +4241,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4281,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 +4307,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4347,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 +4373,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4413,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 +4439,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4479,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 +4505,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4545,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 +4571,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4611,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 +4637,30 @@ 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 { + var zeroVal []*model.BlockTransaction + return zeroVal, 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 +4677,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 +4713,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4753,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 +4779,30 @@ 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 { + var zeroVal *model.TxFee + return zeroVal, 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 +4819,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 +4851,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +4891,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 +4935,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 +4961,30 @@ 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 { + var zeroVal int + return zeroVal, 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 +5001,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 +5027,30 @@ 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 { + var zeroVal string + return zeroVal, 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 +5067,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, @@ -2196,8 +5093,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2214,7 +5133,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, @@ -2240,8 +5159,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2258,7 +5199,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, @@ -2284,8 +5225,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2302,7 +5265,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, @@ -2328,8 +5291,30 @@ 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 { + var zeroVal []*model.GnoEventAttribute + return zeroVal, 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) @@ -2343,7 +5328,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, @@ -2375,8 +5360,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2393,7 +5400,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, @@ -2419,8 +5426,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2437,7 +5466,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, @@ -2463,8 +5492,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2481,7 +5532,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, @@ -2507,8 +5558,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2525,7 +5598,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, @@ -2551,10 +5624,32 @@ 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 { + 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 { + var zeroVal string + return zeroVal, 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 } @@ -2569,7 +5664,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, @@ -2595,8 +5690,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2613,7 +5730,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, @@ -2639,8 +5756,30 @@ 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 { + var zeroVal []*model.MemFile + return zeroVal, 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) @@ -2654,7 +5793,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, @@ -2686,8 +5825,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2704,7 +5865,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, @@ -2730,8 +5891,30 @@ 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 { + var zeroVal *model.MemPackage + return zeroVal, 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) @@ -2748,7 +5931,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, @@ -2782,8 +5965,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2800,7 +6005,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, @@ -2826,8 +6031,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2844,7 +6071,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, @@ -2870,8 +6097,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2888,7 +6137,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, @@ -2914,8 +6163,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2932,7 +6203,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, @@ -2958,8 +6229,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -2976,7 +6269,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, @@ -3002,8 +6295,30 @@ 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 { + var zeroVal []string + return zeroVal, 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) @@ -3017,7 +6332,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, @@ -3043,8 +6358,30 @@ 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 + 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 { + var zeroVal string + return zeroVal, 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) @@ -3061,7 +6398,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, @@ -3087,8 +6424,30 @@ 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 { + var zeroVal string + return zeroVal, 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) @@ -3105,7 +6464,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, @@ -3131,8 +6490,30 @@ 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 { + var zeroVal *model.MemPackage + return zeroVal, 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) @@ -3149,7 +6530,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 +6746,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 +6759,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 +6773,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,41 +6782,55 @@ 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___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + 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 __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Block", field.Name) }, } defer func() { @@ -3445,15 +6840,15 @@ func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + 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___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +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 } @@ -3466,7 +6861,7 @@ func (ec *executionContext) _Query___schema(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 ec.introspectSchema() + return ec.resolvers.Query().GetTransactions(rctx, fc.Args["where"].(model.FilterTransaction)) }) if err != nil { ec.Error(ctx, err) @@ -3475,37 +6870,187 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.([]*model.Transaction) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalOTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionᚄ(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_getTransactions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: false, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) + 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 __Schema", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Transaction", field.Name) }, } - return fc, nil -} + 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) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", 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___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(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.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} func (ec *executionContext) _Subscription_transactions(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) { fc, err := ec.fieldContext_Subscription_transactions(ctx, field) @@ -3705,140 +7250,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) { ctx = rctx // use context from middleware stack in children - return obj.Index(), nil + return ec.resolvers.Subscription().GetTransactions(rctx, fc.Args["where"].(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(ctx 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) { - ctx = rctx // use context from middleware stack in children - return obj.Hash(), nil - }) - 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(ctx 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) { ctx = rctx // use context from middleware stack in children - return obj.Success(), nil + return ec.resolvers.Subscription().GetBlocks(rctx, fc.Args["where"].(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) -} - -func (ec *executionContext) fieldContext_Transaction_success(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Transaction", + 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_Subscription_getBlocks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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 } @@ -3850,8 +7461,35 @@ 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.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 { + var zeroVal int + return zeroVal, err + } + if ec.directives.Filterable == nil { + var zeroVal int + return zeroVal, 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 +7506,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_index(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Transaction", Field: field, @@ -3881,8 +7519,8 @@ func (ec *executionContext) fieldContext_Transaction_block_height(ctx context.Co 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 } @@ -3894,8 +7532,30 @@ 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.Hash(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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) @@ -3907,26 +7567,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(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, 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 } @@ -3938,8 +7598,30 @@ 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.Success(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal bool + return zeroVal, 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) @@ -3951,26 +7633,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(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, 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 } @@ -3982,42 +7664,66 @@ 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.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 { + var zeroVal int + return zeroVal, err + } + if ec.directives.Filterable == nil { + var zeroVal int + return zeroVal, 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) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Coin) + res := resTmp.(int) fc.Result = res - return ec.marshalOCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) + return ec.marshalNInt2int(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_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) { - 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 Int does not have child fields") }, } 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) +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 } @@ -4029,8 +7735,30 @@ func (ec *executionContext) _Transaction_content_raw(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.ContentRaw(), 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 { + var zeroVal int + return zeroVal, 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) @@ -4042,26 +7770,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(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, 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_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 } @@ -4073,8 +7801,30 @@ 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.GasUsed(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal int + return zeroVal, 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) @@ -4086,34 +7836,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(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, 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_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 } @@ -4125,39 +7867,64 @@ 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.GasFee(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal *model.Coin + return zeroVal, 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.marshalNString2string(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_memo(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, 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 "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_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_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 } @@ -4170,7 +7937,7 @@ 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 + return obj.ContentRaw(), nil }) if err != nil { ec.Error(ctx, err) @@ -4182,38 +7949,26 @@ func (ec *executionContext) _Transaction_response(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*model.TransactionResponse) + res := resTmp.(string) fc.Result = res - return ec.marshalNTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionResponse(ctx, field.Selections, res) + return ec.marshalNString2string(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_content_raw(_ 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 "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 nil, errors.New("field of type String does not have child fields") }, } 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_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 } @@ -4225,8 +7980,30 @@ 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 + 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 { + var zeroVal []*model.TransactionMessage + return zeroVal, 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) @@ -4238,26 +8015,34 @@ func (ec *executionContext) _TransactionMessage_typeUrl(ctx context.Context, fie } 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_typeUrl(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: "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_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_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 } @@ -4269,8 +8054,30 @@ 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.Memo(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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,11 +8094,11 @@ 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_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 String does not have child fields") @@ -4300,8 +8107,8 @@ func (ec *executionContext) fieldContext_TransactionMessage_route(ctx context.Co 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_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 } @@ -4313,8 +8120,30 @@ 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.Response(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal *model.TransactionResponse + return zeroVal, 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) @@ -4326,26 +8155,38 @@ func (ec *executionContext) _TransactionMessage_value(ctx context.Context, field } return graphql.Null } - res := resTmp.(model.MessageValue) + res := resTmp.(*model.TransactionResponse) fc.Result = res - return ec.marshalNMessageValue2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageValue(ctx, field.Selections, res) + return ec.marshalNTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionResponse(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_Transaction_response(_ 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") + 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_log(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionResponse_log(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 } @@ -4357,8 +8198,30 @@ 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.TypeURL, nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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,11 +8238,11 @@ 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_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") @@ -4388,8 +8251,8 @@ func (ec *executionContext) fieldContext_TransactionResponse_log(ctx context.Con 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_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 } @@ -4401,8 +8264,30 @@ 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.Route, nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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,11 +8304,11 @@ 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_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") @@ -4432,8 +8317,8 @@ func (ec *executionContext) fieldContext_TransactionResponse_info(ctx context.Co 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_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 } @@ -4445,8 +8330,30 @@ 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.Value, nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal model.MessageValue + return zeroVal, 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.MessageValue); ok { + return data, nil + } + 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) @@ -4458,26 +8365,26 @@ func (ec *executionContext) _TransactionResponse_error(ctx context.Context, fiel } 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_error(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: "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_data(ctx context.Context, field graphql.CollectedField, obj *model.TransactionResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TransactionResponse_data(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 } @@ -4489,8 +8396,30 @@ 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.Log(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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 +8436,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_log(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "TransactionResponse", Field: field, @@ -4520,8 +8449,8 @@ func (ec *executionContext) fieldContext_TransactionResponse_data(ctx context.Co 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_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 } @@ -4533,36 +8462,61 @@ 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.Info(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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(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, 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_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 } @@ -4574,8 +8528,30 @@ 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.Error(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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) @@ -4587,26 +8563,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(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: "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_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 } @@ -4618,8 +8594,30 @@ 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.Data(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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) @@ -4631,32 +8629,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(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: "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_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 } @@ -4668,8 +8660,209 @@ 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.Events(), nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal []model.Event + return zeroVal, 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 { + return graphql.Null + } + res := resTmp.([]model.Event) + fc.Result = res + return ec.marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TransactionResponse_events(_ 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 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) + 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) { + 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 { + var zeroVal int + return zeroVal, 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) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TxFee_gas_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + 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 Int 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) + 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) { + 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 { + var zeroVal *model.Coin + return zeroVal, 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.(*model.Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TxFee_gas_fee(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TxFee", + Field: field, + IsMethod: false, + 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) _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 + } + 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.Raw, nil }) if err != nil { ec.Error(ctx, err) @@ -4686,7 +8879,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, @@ -4712,8 +8905,30 @@ 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.Value, nil + } + + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Filterable == nil { + var zeroVal string + return zeroVal, 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) @@ -4730,7 +8945,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 +8989,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 +9030,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 +9074,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 +9118,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 +9172,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 +9216,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 +9257,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 +9301,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 +9342,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 +9386,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 +9427,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 +9471,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 +9525,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 +9591,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 +9632,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 +9676,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 +9717,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 +9761,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 +9824,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 +9865,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 +9909,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 +9975,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 +10038,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 +10101,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 +10167,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 +10223,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 +10264,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 +10305,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 +10412,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 +10475,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 +10600,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 +10651,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 +10714,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,543 +10943,3511 @@ 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) 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{"name", "body"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "from_address", "to_address", "amount"} 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.unmarshalOFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(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.unmarshalOFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBankMsgSend(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) + 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.Name = data - case "path": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - data, err := ec.unmarshalOString2ᚖstring(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.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.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.Files = 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) unmarshalInputMsgAddPackageInput(ctx context.Context, obj interface{}) (model.MsgAddPackageInput, error) { - var it model.MsgAddPackageInput +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{"creator", "package", "deposit"} + 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 "creator": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("creator")) - 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.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) + 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.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.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.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.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.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 { + it.Hash = data + case "height": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("height")) + data, err := ec.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(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.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.PkgPath = data - case "func": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + 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.Func = data - case "args": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("args")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + 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.Args = data + it.Time = data + case "num_txs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("num_txs")) + 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.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(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) unmarshalInputMsgRunInput(ctx context.Context, obj interface{}) (model.MsgRunInput, error) { - var it model.MsgRunInput +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{"caller", "send", "package"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "hash", "fee", "memo"} 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.unmarshalOFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(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.unmarshalOFilterBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlockTransaction(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.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.Package = 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) unmarshalInputTransactionBankMessageInput(ctx context.Context, obj interface{}) (model.TransactionBankMessageInput, error) { - var it model.TransactionBankMessageInput +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{"send"} + fieldsInOrder := [...]string{"exists", "eq"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "send": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) - data, err := ec.unmarshalOBankMsgSendInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBankMsgSendInput(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.Send = data + 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.Eq = data } } return it, nil } -func (ec *executionContext) unmarshalInputTransactionFilter(ctx context.Context, obj interface{}) (model.TransactionFilter, error) { - var it model.TransactionFilter +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{"from_block_height", "to_block_height", "from_index", "to_index", "from_gas_wanted", "to_gas_wanted", "from_gas_used", "to_gas_used", "hash", "message", "memo", "success", "events"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "amount", "denom"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "from_block_height": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_block_height")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - it.FromBlockHeight = data - case "to_block_height": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_block_height")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - it.ToBlockHeight = data - case "from_index": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_index")) - data, err := ec.unmarshalOInt2ᚖint(ctx, v) - if err != nil { - return it, err - } - it.FromIndex = data - case "to_index": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_index")) - data, err := ec.unmarshalOInt2ᚖint(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.ToIndex = data - case "from_gas_wanted": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_gas_wanted")) - data, err := ec.unmarshalOInt2ᚖint(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.FromGasWanted = data - case "to_gas_wanted": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_gas_wanted")) - data, err := ec.unmarshalOInt2ᚖint(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.ToGasWanted = data - case "from_gas_used": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_gas_used")) - data, err := ec.unmarshalOInt2ᚖint(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.FromGasUsed = data - case "to_gas_used": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_gas_used")) - data, err := ec.unmarshalOInt2ᚖint(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.ToGasUsed = data - case "hash": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + it.Denom = data + } + } + + return it, nil +} + +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{"_and", "_or", "_not", "GnoEvent", "UnknownEvent"} + 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.unmarshalOFilterEvent2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterEvent(ctx, v) if err != nil { return it, err } - it.Hash = data - case "message": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) - data, err := ec.unmarshalOTransactionMessageInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessageInputᚄ(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.Message = data - case "memo": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + 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.Memo = data - case "success": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("success")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + 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.Success = data - case "events": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("events")) - data, err := ec.unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInputᚄ(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.Events = data + it.UnknownEvent = data } } return it, nil } -func (ec *executionContext) unmarshalInputTransactionMessageInput(ctx context.Context, obj interface{}) (model.TransactionMessageInput, error) { - var it model.TransactionMessageInput +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{"type_url", "route", "bank_param", "vm_param"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "type", "pkg_path", "func", "attrs"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "type_url": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type_url")) - data, err := ec.unmarshalOMessageType2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageType(ctx, v) + 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.TypeURL = data - case "route": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("route")) - data, err := ec.unmarshalOMessageRoute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageRoute(ctx, v) + 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.Route = data - case "bank_param": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bank_param")) - data, err := ec.unmarshalOTransactionBankMessageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionBankMessageInput(ctx, v) + 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.BankParam = data - case "vm_param": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("vm_param")) - data, err := ec.unmarshalOTransactionVmMessageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionVMMessageInput(ctx, v) + 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.VMParam = data + 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) unmarshalInputTransactionVmMessageInput(ctx context.Context, obj interface{}) (model.TransactionVMMessageInput, error) { - var it model.TransactionVMMessageInput +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{"exec", "add_package", "run"} + fieldsInOrder := [...]string{"_and", "_or", "_not", "key", "value"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "exec": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exec")) - data, err := ec.unmarshalOMsgCallInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgCallInput(ctx, v) + 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.Exec = data - case "add_package": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("add_package")) - data, err := ec.unmarshalOMsgAddPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgAddPackageInput(ctx, v) + 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.AddPackage = data - case "run": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("run")) - data, err := ec.unmarshalOMsgRunInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgRunInput(ctx, v) + 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.Run = data - } - } - - return it, nil -} - -// endregion **************************** input.gotpl ***************************** + 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 + } + } -// region ************************** interface.gotpl *************************** + return it, nil +} -func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, obj model.Event) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.GnoEvent: - return ec._GnoEvent(ctx, sel, &obj) - case *model.GnoEvent: - if obj == nil { - return graphql.Null +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", "gt", "lt"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - return ec._GnoEvent(ctx, sel, obj) - case model.UnknownEvent: - return ec._UnknownEvent(ctx, sel, &obj) - case *model.UnknownEvent: - if obj == nil { - return graphql.Null + 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 "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 ec._UnknownEvent(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) } + + return it, nil } -func (ec *executionContext) _MessageValue(ctx context.Context, sel ast.SelectionSet, obj model.MessageValue) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.BankMsgSend: - return ec._BankMsgSend(ctx, sel, &obj) - case *model.BankMsgSend: - if obj == nil { - return graphql.Null +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{"_and", "_or", "_not", "name", "body"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue } - return ec._BankMsgSend(ctx, sel, obj) - case model.MsgCall: - return ec._MsgCall(ctx, sel, &obj) - case *model.MsgCall: - if obj == nil { - return graphql.Null + switch k { + 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.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.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 ec._MsgCall(ctx, sel, obj) - case model.MsgAddPackage: - return ec._MsgAddPackage(ctx, sel, &obj) - case *model.MsgAddPackage: - if obj == nil { - return graphql.Null + } + + 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 } - return ec._MsgAddPackage(ctx, sel, obj) - case model.MsgRun: - return ec._MsgRun(ctx, sel, &obj) - case *model.MsgRun: - if obj == nil { - return graphql.Null + 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 ec._MsgRun(ctx, sel, obj) - case model.UnexpectedMessage: - return ec._UnexpectedMessage(ctx, sel, &obj) - case *model.UnexpectedMessage: - if obj == nil { - return graphql.Null + } + + 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 } - return ec._UnexpectedMessage(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) + 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", "like"} + 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 "like": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("like")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Like = 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", "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 "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.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) 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{"_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.unmarshalONestedFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx, v) + if err != nil { + return it, err + } + 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.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.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) 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.unmarshalOFilterInt2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterInt(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) 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", "GnoEvent", "UnknownEvent"} + 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.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.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.unmarshalONestedFilterEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterEvent(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) 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", "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.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.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.unmarshalONestedFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEvent(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) 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", "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.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.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.unmarshalONestedFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(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) 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{"_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.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) 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{"_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.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) 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{"_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.unmarshalONestedFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMessageValue(ctx, v) + if err != nil { + return it, err + } + 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.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.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) 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{"_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.unmarshalONestedFilterMsgAddPackage2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgAddPackage(ctx, v) + if err != nil { + return it, err + } + 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.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.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) 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", "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.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.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.unmarshalONestedFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgCall(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) 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", "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.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.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.unmarshalONestedFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(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) 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", "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.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 + 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) 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", "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.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 + 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) 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.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) 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{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"send"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "send": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("send")) + data, err := ec.unmarshalOBankMsgSendInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBankMsgSendInput(ctx, v) + if err != nil { + return it, err + } + it.Send = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTransactionFilter(ctx context.Context, obj interface{}) (model.TransactionFilter, error) { + var it model.TransactionFilter + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"from_block_height", "to_block_height", "from_index", "to_index", "from_gas_wanted", "to_gas_wanted", "from_gas_used", "to_gas_used", "hash", "message", "memo", "success", "events"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "from_block_height": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_block_height")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FromBlockHeight = data + case "to_block_height": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_block_height")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ToBlockHeight = data + case "from_index": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_index")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FromIndex = data + case "to_index": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_index")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ToIndex = data + case "from_gas_wanted": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_gas_wanted")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FromGasWanted = data + case "to_gas_wanted": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_gas_wanted")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ToGasWanted = data + case "from_gas_used": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from_gas_used")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.FromGasUsed = data + case "to_gas_used": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("to_gas_used")) + data, err := ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + it.ToGasUsed = data + case "hash": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hash")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Hash = data + case "message": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("message")) + data, err := ec.unmarshalOTransactionMessageInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessageInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Message = data + case "memo": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("memo")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Memo = data + case "success": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("success")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Success = data + case "events": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("events")) + data, err := ec.unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Events = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTransactionMessageInput(ctx context.Context, obj interface{}) (model.TransactionMessageInput, error) { + var it model.TransactionMessageInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"type_url", "route", "bank_param", "vm_param"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "type_url": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type_url")) + data, err := ec.unmarshalOMessageType2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageType(ctx, v) + if err != nil { + return it, err + } + it.TypeURL = data + case "route": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("route")) + data, err := ec.unmarshalOMessageRoute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageRoute(ctx, v) + if err != nil { + return it, err + } + it.Route = data + case "bank_param": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bank_param")) + data, err := ec.unmarshalOTransactionBankMessageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionBankMessageInput(ctx, v) + if err != nil { + return it, err + } + it.BankParam = data + case "vm_param": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("vm_param")) + data, err := ec.unmarshalOTransactionVmMessageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionVMMessageInput(ctx, v) + if err != nil { + return it, err + } + it.VMParam = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTransactionVmMessageInput(ctx context.Context, obj interface{}) (model.TransactionVMMessageInput, error) { + var it model.TransactionVMMessageInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"exec", "add_package", "run"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "exec": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exec")) + data, err := ec.unmarshalOMsgCallInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgCallInput(ctx, v) + if err != nil { + return it, err + } + it.Exec = data + case "add_package": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("add_package")) + data, err := ec.unmarshalOMsgAddPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgAddPackageInput(ctx, v) + if err != nil { + return it, err + } + it.AddPackage = data + case "run": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("run")) + data, err := ec.unmarshalOMsgRunInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgRunInput(ctx, v) + if err != nil { + return it, err + } + it.Run = data + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, obj model.Event) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.GnoEvent: + return ec._GnoEvent(ctx, sel, &obj) + case *model.GnoEvent: + if obj == nil { + return graphql.Null + } + return ec._GnoEvent(ctx, sel, obj) + case model.UnknownEvent: + return ec._UnknownEvent(ctx, sel, &obj) + case *model.UnknownEvent: + if obj == nil { + return graphql.Null + } + return ec._UnknownEvent(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +func (ec *executionContext) _MessageValue(ctx context.Context, sel ast.SelectionSet, obj model.MessageValue) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case model.BankMsgSend: + return ec._BankMsgSend(ctx, sel, &obj) + case *model.BankMsgSend: + if obj == nil { + return graphql.Null + } + return ec._BankMsgSend(ctx, sel, obj) + case model.MsgCall: + return ec._MsgCall(ctx, sel, &obj) + case *model.MsgCall: + if obj == nil { + return graphql.Null + } + return ec._MsgCall(ctx, sel, obj) + case model.MsgAddPackage: + return ec._MsgAddPackage(ctx, sel, &obj) + case *model.MsgAddPackage: + if obj == nil { + return graphql.Null + } + return ec._MsgAddPackage(ctx, sel, obj) + case model.MsgRun: + return ec._MsgRun(ctx, sel, &obj) + case *model.MsgRun: + if obj == nil { + return graphql.Null + } + return ec._MsgRun(ctx, sel, obj) + case model.UnexpectedMessage: + return ec._UnexpectedMessage(ctx, sel, &obj) + case *model.UnexpectedMessage: + if obj == nil { + return graphql.Null + } + return ec._UnexpectedMessage(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var bankMsgSendImplementors = []string{"BankMsgSend", "MessageValue"} + +func (ec *executionContext) _BankMsgSend(ctx context.Context, sel ast.SelectionSet, obj *model.BankMsgSend) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, bankMsgSendImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BankMsgSend") + case "from_address": + out.Values[i] = ec._BankMsgSend_from_address(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "to_address": + out.Values[i] = ec._BankMsgSend_to_address(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "amount": + out.Values[i] = ec._BankMsgSend_amount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var blockImplementors = []string{"Block"} + +func (ec *executionContext) _Block(ctx context.Context, sel ast.SelectionSet, obj *model.Block) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, blockImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Block") + case "hash": + out.Values[i] = ec._Block_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "height": + out.Values[i] = ec._Block_height(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "version": + out.Values[i] = ec._Block_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "chain_id": + out.Values[i] = ec._Block_chain_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "time": + out.Values[i] = ec._Block_time(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "num_txs": + out.Values[i] = ec._Block_num_txs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "total_txs": + out.Values[i] = ec._Block_total_txs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "app_version": + out.Values[i] = ec._Block_app_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "last_block_hash": + out.Values[i] = ec._Block_last_block_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "last_commit_hash": + out.Values[i] = ec._Block_last_commit_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "validators_hash": + out.Values[i] = ec._Block_validators_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "next_validators_hash": + out.Values[i] = ec._Block_next_validators_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "consensus_hash": + out.Values[i] = ec._Block_consensus_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "app_hash": + out.Values[i] = ec._Block_app_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "last_results_hash": + out.Values[i] = ec._Block_last_results_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "proposer_address_raw": + out.Values[i] = ec._Block_proposer_address_raw(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "txs": + out.Values[i] = ec._Block_txs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var blockTransactionImplementors = []string{"BlockTransaction"} + +func (ec *executionContext) _BlockTransaction(ctx context.Context, sel ast.SelectionSet, obj *model.BlockTransaction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, blockTransactionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BlockTransaction") + case "hash": + out.Values[i] = ec._BlockTransaction_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fee": + out.Values[i] = ec._BlockTransaction_fee(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "memo": + out.Values[i] = ec._BlockTransaction_memo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "content_raw": + out.Values[i] = ec._BlockTransaction_content_raw(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var coinImplementors = []string{"Coin"} + +func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj *model.Coin) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, coinImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Coin") + case "amount": + out.Values[i] = ec._Coin_amount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "denom": + out.Values[i] = ec._Coin_denom(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var gnoEventImplementors = []string{"GnoEvent", "Event"} + +func (ec *executionContext) _GnoEvent(ctx context.Context, sel ast.SelectionSet, obj *model.GnoEvent) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, gnoEventImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GnoEvent") + case "type": + out.Values[i] = ec._GnoEvent_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pkg_path": + out.Values[i] = ec._GnoEvent_pkg_path(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "func": + out.Values[i] = ec._GnoEvent_func(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "attrs": + out.Values[i] = ec._GnoEvent_attrs(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var gnoEventAttributeImplementors = []string{"GnoEventAttribute"} + +func (ec *executionContext) _GnoEventAttribute(ctx context.Context, sel ast.SelectionSet, obj *model.GnoEventAttribute) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, gnoEventAttributeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GnoEventAttribute") + case "key": + out.Values[i] = ec._GnoEventAttribute_key(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "value": + out.Values[i] = ec._GnoEventAttribute_value(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var memFileImplementors = []string{"MemFile"} + +func (ec *executionContext) _MemFile(ctx context.Context, sel ast.SelectionSet, obj *model.MemFile) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, memFileImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MemFile") + case "name": + out.Values[i] = ec._MemFile_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "body": + out.Values[i] = ec._MemFile_body(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var memPackageImplementors = []string{"MemPackage"} + +func (ec *executionContext) _MemPackage(ctx context.Context, sel ast.SelectionSet, obj *model.MemPackage) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, memPackageImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MemPackage") + case "name": + out.Values[i] = ec._MemPackage_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "path": + out.Values[i] = ec._MemPackage_path(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "files": + out.Values[i] = ec._MemPackage_files(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var msgAddPackageImplementors = []string{"MsgAddPackage", "MessageValue"} + +func (ec *executionContext) _MsgAddPackage(ctx context.Context, sel ast.SelectionSet, obj *model.MsgAddPackage) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, msgAddPackageImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MsgAddPackage") + case "creator": + out.Values[i] = ec._MsgAddPackage_creator(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "package": + out.Values[i] = ec._MsgAddPackage_package(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deposit": + out.Values[i] = ec._MsgAddPackage_deposit(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var msgCallImplementors = []string{"MsgCall", "MessageValue"} + +func (ec *executionContext) _MsgCall(ctx context.Context, sel ast.SelectionSet, obj *model.MsgCall) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, msgCallImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MsgCall") + case "caller": + out.Values[i] = ec._MsgCall_caller(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "send": + out.Values[i] = ec._MsgCall_send(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pkg_path": + out.Values[i] = ec._MsgCall_pkg_path(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "func": + out.Values[i] = ec._MsgCall_func(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec._MsgCall_args(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null } -} -// endregion ************************** interface.gotpl *************************** + atomic.AddInt32(&ec.deferred, int32(len(deferred))) -// region **************************** object.gotpl **************************** + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } -var bankMsgSendImplementors = []string{"BankMsgSend", "MessageValue"} + return out +} -func (ec *executionContext) _BankMsgSend(ctx context.Context, sel ast.SelectionSet, obj *model.BankMsgSend) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, bankMsgSendImplementors) +var msgRunImplementors = []string{"MsgRun", "MessageValue"} + +func (ec *executionContext) _MsgRun(ctx context.Context, sel ast.SelectionSet, obj *model.MsgRun) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, msgRunImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("BankMsgSend") - case "from_address": - out.Values[i] = ec._BankMsgSend_from_address(ctx, field, obj) + out.Values[i] = graphql.MarshalString("MsgRun") + case "caller": + out.Values[i] = ec._MsgRun_caller(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "to_address": - out.Values[i] = ec._BankMsgSend_to_address(ctx, field, obj) + case "send": + out.Values[i] = ec._MsgRun_send(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "amount": - out.Values[i] = ec._BankMsgSend_amount(ctx, field, obj) + case "package": + out.Values[i] = ec._MsgRun_package(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -7291,99 +14474,289 @@ func (ec *executionContext) _BankMsgSend(ctx context.Context, sel ast.SelectionS return out } -var blockImplementors = []string{"Block"} +var queryImplementors = []string{"Query"} -func (ec *executionContext) _Block(ctx context.Context, sel ast.SelectionSet, obj *model.Block) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, blockImplementors) +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Block") - case "hash": - out.Values[i] = ec._Block_hash(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + out.Values[i] = graphql.MarshalString("Query") + 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 } - case "height": - out.Values[i] = ec._Block_height(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - case "version": - out.Values[i] = ec._Block_version(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + 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 } - case "chain_id": - out.Values[i] = ec._Block_chain_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - case "time": - out.Values[i] = ec._Block_time(ctx, field, obj) + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + 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.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) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var subscriptionImplementors = []string{"Subscription"} + +func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func(ctx context.Context) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Subscription", + }) + if len(fields) != 1 { + ec.Errorf(ctx, "must subscribe to exactly one stream") + return nil + } + + switch fields[0].Name { + case "transactions": + 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)) + } +} + +var transactionImplementors = []string{"Transaction"} + +func (ec *executionContext) _Transaction(ctx context.Context, sel ast.SelectionSet, obj *model.Transaction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, transactionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Transaction") + case "index": + out.Values[i] = ec._Transaction_index(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "num_txs": - out.Values[i] = ec._Block_num_txs(ctx, field, obj) + case "hash": + out.Values[i] = ec._Transaction_hash(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "total_txs": - out.Values[i] = ec._Block_total_txs(ctx, field, obj) + case "success": + out.Values[i] = ec._Transaction_success(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "app_version": - out.Values[i] = ec._Block_app_version(ctx, field, obj) + case "block_height": + out.Values[i] = ec._Transaction_block_height(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "last_block_hash": - out.Values[i] = ec._Block_last_block_hash(ctx, field, obj) + case "gas_wanted": + out.Values[i] = ec._Transaction_gas_wanted(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "last_commit_hash": - out.Values[i] = ec._Block_last_commit_hash(ctx, field, obj) + case "gas_used": + out.Values[i] = ec._Transaction_gas_used(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "validators_hash": - out.Values[i] = ec._Block_validators_hash(ctx, field, obj) + case "gas_fee": + out.Values[i] = ec._Transaction_gas_fee(ctx, field, obj) + case "content_raw": + out.Values[i] = ec._Transaction_content_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "next_validators_hash": - out.Values[i] = ec._Block_next_validators_hash(ctx, field, obj) + case "messages": + out.Values[i] = ec._Transaction_messages(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "consensus_hash": - out.Values[i] = ec._Block_consensus_hash(ctx, field, obj) + case "memo": + out.Values[i] = ec._Transaction_memo(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "app_hash": - out.Values[i] = ec._Block_app_hash(ctx, field, obj) + case "response": + out.Values[i] = ec._Transaction_response(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "last_results_hash": - out.Values[i] = ec._Block_last_results_hash(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var transactionMessageImplementors = []string{"TransactionMessage"} + +func (ec *executionContext) _TransactionMessage(ctx context.Context, sel ast.SelectionSet, obj *model.TransactionMessage) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, transactionMessageImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("TransactionMessage") + case "typeUrl": + out.Values[i] = ec._TransactionMessage_typeUrl(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "proposer_address_raw": - out.Values[i] = ec._Block_proposer_address_raw(ctx, field, obj) + case "route": + out.Values[i] = ec._TransactionMessage_route(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "txs": - out.Values[i] = ec._Block_txs(ctx, field, obj) + case "value": + out.Values[i] = ec._TransactionMessage_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -7410,37 +14783,39 @@ func (ec *executionContext) _Block(ctx context.Context, sel ast.SelectionSet, ob return out } -var blockTransactionImplementors = []string{"BlockTransaction"} +var transactionResponseImplementors = []string{"TransactionResponse"} -func (ec *executionContext) _BlockTransaction(ctx context.Context, sel ast.SelectionSet, obj *model.BlockTransaction) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, blockTransactionImplementors) +func (ec *executionContext) _TransactionResponse(ctx context.Context, sel ast.SelectionSet, obj *model.TransactionResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, transactionResponseImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("BlockTransaction") - case "hash": - out.Values[i] = ec._BlockTransaction_hash(ctx, field, obj) + out.Values[i] = graphql.MarshalString("TransactionResponse") + case "log": + out.Values[i] = ec._TransactionResponse_log(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "fee": - out.Values[i] = ec._BlockTransaction_fee(ctx, field, obj) + case "info": + out.Values[i] = ec._TransactionResponse_info(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "memo": - out.Values[i] = ec._BlockTransaction_memo(ctx, field, obj) + case "error": + out.Values[i] = ec._TransactionResponse_error(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "content_raw": - out.Values[i] = ec._BlockTransaction_content_raw(ctx, field, obj) + case "data": + out.Values[i] = ec._TransactionResponse_data(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "events": + out.Values[i] = ec._TransactionResponse_events(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7464,24 +14839,24 @@ func (ec *executionContext) _BlockTransaction(ctx context.Context, sel ast.Selec return out } -var coinImplementors = []string{"Coin"} +var txFeeImplementors = []string{"TxFee"} -func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj *model.Coin) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, coinImplementors) +func (ec *executionContext) _TxFee(ctx context.Context, sel ast.SelectionSet, obj *model.TxFee) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, txFeeImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Coin") - case "amount": - out.Values[i] = ec._Coin_amount(ctx, field, obj) + out.Values[i] = graphql.MarshalString("TxFee") + case "gas_wanted": + out.Values[i] = ec._TxFee_gas_wanted(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "denom": - out.Values[i] = ec._Coin_denom(ctx, field, obj) + case "gas_fee": + out.Values[i] = ec._TxFee_gas_fee(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -7508,34 +14883,22 @@ func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj return out } -var gnoEventImplementors = []string{"GnoEvent", "Event"} +var unexpectedMessageImplementors = []string{"UnexpectedMessage", "MessageValue"} -func (ec *executionContext) _GnoEvent(ctx context.Context, sel ast.SelectionSet, obj *model.GnoEvent) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gnoEventImplementors) +func (ec *executionContext) _UnexpectedMessage(ctx context.Context, sel ast.SelectionSet, obj *model.UnexpectedMessage) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, unexpectedMessageImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("GnoEvent") - case "type": - out.Values[i] = ec._GnoEvent_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pkg_path": - out.Values[i] = ec._GnoEvent_pkg_path(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "func": - out.Values[i] = ec._GnoEvent_func(ctx, field, obj) + out.Values[i] = graphql.MarshalString("UnexpectedMessage") + case "raw": + out.Values[i] = ec._UnexpectedMessage_raw(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "attrs": - out.Values[i] = ec._GnoEvent_attrs(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7559,24 +14922,19 @@ func (ec *executionContext) _GnoEvent(ctx context.Context, sel ast.SelectionSet, return out } -var gnoEventAttributeImplementors = []string{"GnoEventAttribute"} +var unknownEventImplementors = []string{"UnknownEvent", "Event"} -func (ec *executionContext) _GnoEventAttribute(ctx context.Context, sel ast.SelectionSet, obj *model.GnoEventAttribute) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gnoEventAttributeImplementors) +func (ec *executionContext) _UnknownEvent(ctx context.Context, sel ast.SelectionSet, obj *model.UnknownEvent) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, unknownEventImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("GnoEventAttribute") - case "key": - out.Values[i] = ec._GnoEventAttribute_key(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } + out.Values[i] = graphql.MarshalString("UnknownEvent") case "value": - out.Values[i] = ec._GnoEventAttribute_value(ctx, field, obj) + out.Values[i] = ec._UnknownEvent_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -7603,24 +14961,36 @@ func (ec *executionContext) _GnoEventAttribute(ctx context.Context, sel ast.Sele return out } -var memFileImplementors = []string{"MemFile"} +var __DirectiveImplementors = []string{"__Directive"} -func (ec *executionContext) _MemFile(ctx context.Context, sel ast.SelectionSet, obj *model.MemFile) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, memFileImplementors) +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("MemFile") + out.Values[i] = graphql.MarshalString("__Directive") case "name": - out.Values[i] = ec._MemFile_name(ctx, field, obj) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "body": - out.Values[i] = ec._MemFile_body(ctx, field, obj) + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -7647,29 +15017,31 @@ func (ec *executionContext) _MemFile(ctx context.Context, sel ast.SelectionSet, return out } -var memPackageImplementors = []string{"MemPackage"} +var __EnumValueImplementors = []string{"__EnumValue"} -func (ec *executionContext) _MemPackage(ctx context.Context, sel ast.SelectionSet, obj *model.MemPackage) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, memPackageImplementors) +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("MemPackage") + out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - out.Values[i] = ec._MemPackage_name(ctx, field, obj) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "path": - out.Values[i] = ec._MemPackage_path(ctx, field, obj) + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "files": - out.Values[i] = ec._MemPackage_files(ctx, field, obj) + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7693,32 +15065,41 @@ func (ec *executionContext) _MemPackage(ctx context.Context, sel ast.SelectionSe return out } -var msgAddPackageImplementors = []string{"MsgAddPackage", "MessageValue"} +var __FieldImplementors = []string{"__Field"} -func (ec *executionContext) _MsgAddPackage(ctx context.Context, sel ast.SelectionSet, obj *model.MsgAddPackage) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, msgAddPackageImplementors) +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("MsgAddPackage") - case "creator": - out.Values[i] = ec._MsgAddPackage_creator(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "package": - out.Values[i] = ec._MsgAddPackage_package(ctx, field, obj) + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "deposit": - out.Values[i] = ec._MsgAddPackage_deposit(ctx, field, obj) + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7742,39 +15123,31 @@ func (ec *executionContext) _MsgAddPackage(ctx context.Context, sel ast.Selectio return out } -var msgCallImplementors = []string{"MsgCall", "MessageValue"} +var __InputValueImplementors = []string{"__InputValue"} -func (ec *executionContext) _MsgCall(ctx context.Context, sel ast.SelectionSet, obj *model.MsgCall) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, msgCallImplementors) +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("MsgCall") - case "caller": - out.Values[i] = ec._MsgCall_caller(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "send": - out.Values[i] = ec._MsgCall_send(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pkg_path": - out.Values[i] = ec._MsgCall_pkg_path(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "func": - out.Values[i] = ec._MsgCall_func(ctx, field, obj) + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "args": - out.Values[i] = ec._MsgCall_args(ctx, field, obj) + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7798,29 +15171,35 @@ func (ec *executionContext) _MsgCall(ctx context.Context, sel ast.SelectionSet, return out } -var msgRunImplementors = []string{"MsgRun", "MessageValue"} +var __SchemaImplementors = []string{"__Schema"} -func (ec *executionContext) _MsgRun(ctx context.Context, sel ast.SelectionSet, obj *model.MsgRun) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, msgRunImplementors) +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("MsgRun") - case "caller": - out.Values[i] = ec._MsgRun_caller(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ - } - case "send": - out.Values[i] = ec._MsgRun_send(ctx, field, obj) + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "package": - out.Values[i] = ec._MsgRun_package(ctx, field, obj) + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -7847,93 +15226,40 @@ func (ec *executionContext) _MsgRun(ctx context.Context, sel ast.SelectionSet, o return out } -var queryImplementors = []string{"Query"} +var __TypeImplementors = []string{"__Type"} -func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Query", - }) +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) - switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "transactions": - 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_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 - - 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_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 - - 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] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } - - 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": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - }) + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7957,687 +15283,671 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -var subscriptionImplementors = []string{"Subscription"} +// endregion **************************** object.gotpl **************************** -func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func(ctx context.Context) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Subscription", - }) - if len(fields) != 1 { - ec.Errorf(ctx, "must subscribe to exactly one stream") - return nil - } +// region ***************************** type.gotpl ***************************** - switch fields[0].Name { - case "transactions": - return ec._Subscription_transactions(ctx, fields[0]) - case "blocks": - return ec._Subscription_blocks(ctx, fields[0]) - default: - panic("unknown field " + strconv.Quote(fields[0].Name)) - } +func (ec *executionContext) marshalNBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlock(ctx context.Context, sel ast.SelectionSet, v model.Block) graphql.Marshaler { + return ec._Block(ctx, sel, &v) } -var transactionImplementors = []string{"Transaction"} +func (ec *executionContext) marshalNBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlock(ctx context.Context, sel ast.SelectionSet, v *model.Block) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Block(ctx, sel, v) +} -func (ec *executionContext) _Transaction(ctx context.Context, sel ast.SelectionSet, obj *model.Transaction) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, transactionImplementors) +func (ec *executionContext) unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockFilter(ctx context.Context, v interface{}) (model.BlockFilter, error) { + res, err := ec.unmarshalInputBlockFilter(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Transaction") - case "index": - out.Values[i] = ec._Transaction_index(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "hash": - out.Values[i] = ec._Transaction_hash(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "success": - out.Values[i] = ec._Transaction_success(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "block_height": - out.Values[i] = ec._Transaction_block_height(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "gas_wanted": - out.Values[i] = ec._Transaction_gas_wanted(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "gas_used": - out.Values[i] = ec._Transaction_gas_used(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "gas_fee": - out.Values[i] = ec._Transaction_gas_fee(ctx, field, obj) - case "content_raw": - out.Values[i] = ec._Transaction_content_raw(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "messages": - out.Values[i] = ec._Transaction_messages(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "memo": - out.Values[i] = ec._Transaction_memo(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "response": - out.Values[i] = ec._Transaction_response(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +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 + 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() } - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalOBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } - out.Dispatch(ctx) - if out.Invalids > 0 { + return res +} + +func (ec *executionContext) marshalNCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx context.Context, sel ast.SelectionSet, v *model.Coin) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } return graphql.Null } + return ec._Coin(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) +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) +} - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } +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) +} - return out +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) } -var transactionMessageImplementors = []string{"TransactionMessage"} +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) _TransactionMessage(ctx context.Context, sel ast.SelectionSet, obj *model.TransactionMessage) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, transactionMessageImplementors) +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) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TransactionMessage") - case "typeUrl": - out.Values[i] = ec._TransactionMessage_typeUrl(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "route": - out.Values[i] = ec._TransactionMessage_route(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "value": - out.Values[i] = ec._TransactionMessage_value(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +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 +} + +func (ec *executionContext) marshalNGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttribute(ctx context.Context, sel ast.SelectionSet, v *model.GnoEventAttribute) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } - } - out.Dispatch(ctx) - if out.Invalids > 0 { return graphql.Null } + return ec._GnoEventAttribute(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } } + return res +} - return out +func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) } -var transactionResponseImplementors = []string{"TransactionResponse"} +func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} -func (ec *executionContext) _TransactionResponse(ctx context.Context, sel ast.SelectionSet, obj *model.TransactionResponse) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, transactionResponseImplementors) +func (ec *executionContext) marshalNMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFile(ctx context.Context, sel ast.SelectionSet, v *model.MemFile) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._MemFile(ctx, sel, v) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TransactionResponse") - case "log": - out.Values[i] = ec._TransactionResponse_log(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "info": - out.Values[i] = ec._TransactionResponse_info(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "error": - out.Values[i] = ec._TransactionResponse_error(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "data": - out.Values[i] = ec._TransactionResponse_data(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "events": - out.Values[i] = ec._TransactionResponse_events(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackage(ctx context.Context, sel ast.SelectionSet, v *model.MemPackage) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } + return graphql.Null } - out.Dispatch(ctx) - if out.Invalids > 0 { + return ec._MemPackage(ctx, sel, v) +} + +func (ec *executionContext) marshalNMessageValue2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageValue(ctx context.Context, sel ast.SelectionSet, v model.MessageValue) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } return graphql.Null } + return ec._MessageValue(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } } + return res +} - return out +func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { + res, err := graphql.UnmarshalTime(v) + return res, graphql.ErrorOnPath(ctx, err) } -var txFeeImplementors = []string{"TxFee"} +func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { + res := graphql.MarshalTime(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} -func (ec *executionContext) _TxFee(ctx context.Context, sel ast.SelectionSet, obj *model.TxFee) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, txFeeImplementors) +func (ec *executionContext) marshalNTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransaction(ctx context.Context, sel ast.SelectionSet, v model.Transaction) graphql.Marshaler { + return ec._Transaction(ctx, sel, &v) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TxFee") - case "gas_wanted": - out.Values[i] = ec._TxFee_gas_wanted(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "gas_fee": - out.Values[i] = ec._TxFee_gas_fee(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +func (ec *executionContext) marshalNTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransaction(ctx context.Context, sel ast.SelectionSet, v *model.Transaction) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Transaction(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNTransactionFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionFilter(ctx context.Context, v interface{}) (model.TransactionFilter, error) { + res, err := ec.unmarshalInputTransactionFilter(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +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 + 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() } - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalOTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessage(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) } + wg.Wait() - return out + return ret } -var unexpectedMessageImplementors = []string{"UnexpectedMessage", "MessageValue"} - -func (ec *executionContext) _UnexpectedMessage(ctx context.Context, sel ast.SelectionSet, obj *model.UnexpectedMessage) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, unexpectedMessageImplementors) +func (ec *executionContext) unmarshalNTransactionMessageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessageInput(ctx context.Context, v interface{}) (*model.TransactionMessageInput, error) { + res, err := ec.unmarshalInputTransactionMessageInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("UnexpectedMessage") - case "raw": - out.Values[i] = ec._UnexpectedMessage_raw(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionResponse(ctx context.Context, sel ast.SelectionSet, v *model.TransactionResponse) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } - } - out.Dispatch(ctx) - if out.Invalids > 0 { return graphql.Null } + return ec._TransactionResponse(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalNTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTxFee(ctx context.Context, sel ast.SelectionSet, v *model.TxFee) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null } - - return out + return ec._TxFee(ctx, sel, v) } -var unknownEventImplementors = []string{"UnknownEvent", "Event"} - -func (ec *executionContext) _UnknownEvent(ctx context.Context, sel ast.SelectionSet, obj *model.UnknownEvent) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, unknownEventImplementors) +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("UnknownEvent") - case "value": - out.Values[i] = ec._UnknownEvent_value(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +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 + 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() } - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + } + wg.Wait() - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return out + return ret } -var __DirectiveImplementors = []string{"__Directive"} - -func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - out.Values[i] = ec.___Directive_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec.___Directive_description(ctx, field, obj) - case "locations": - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "args": - out.Values[i] = ec.___Directive_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "isRepeatable": - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + return res +} - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) } - - return out + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - case "isDeprecated": - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +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 + 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() } - case "deprecationReason": - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + } + wg.Wait() - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return out + return ret } -var __FieldImplementors = []string{"__Field"} +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} -func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": - out.Values[i] = ec.___Field_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec.___Field_description(ctx, field, obj) - case "args": - out.Values[i] = ec.___Field_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "type": - out.Values[i] = ec.___Field_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "isDeprecated": - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +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 + 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() } - case "deprecationReason": - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + } + wg.Wait() - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return out + return ret } -var __InputValueImplementors = []string{"__InputValue"} - -func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": - out.Values[i] = ec.___InputValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec.___InputValue_description(ctx, field, obj) - case "type": - out.Values[i] = ec.___InputValue_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +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 + 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() } - case "defaultValue": - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + } + wg.Wait() - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return out + return ret } -var __SchemaImplementors = []string{"__Schema"} - -func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": - out.Values[i] = ec.___Schema_description(ctx, field, obj) - case "types": - out.Values[i] = ec.___Schema_types(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "queryType": - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "mutationType": - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) - case "subscriptionType": - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - case "directives": - out.Values[i] = ec.___Schema_directives(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } return graphql.Null } + return ec.___Type(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } } - - return out + return res } -var __TypeImplementors = []string{"__Type"} +func (ec *executionContext) unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx context.Context, v interface{}) (*model.AmountInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputAmountInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) +func (ec *executionContext) unmarshalOBankMsgSendInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBankMsgSendInput(ctx context.Context, v interface{}) (*model.BankMsgSendInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputBankMsgSendInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": - out.Values[i] = ec.___Type_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +func (ec *executionContext) marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Block) 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() } - case "name": - out.Values[i] = ec.___Type_name(ctx, field, obj) - case "description": - out.Values[i] = ec.___Type_description(ctx, field, obj) - case "fields": - out.Values[i] = ec.___Type_fields(ctx, field, obj) - case "interfaces": - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - case "possibleTypes": - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) - case "enumValues": - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - case "inputFields": - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) - case "ofType": - out.Values[i] = ec.___Type_ofType(ctx, field, obj) - case "specifiedByURL": - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalNBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlock(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } + } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + return ret +} - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +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) +} - return out +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) } -// endregion **************************** object.gotpl **************************** +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + return res +} -// region ***************************** type.gotpl ***************************** +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) marshalNBlock2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlock(ctx context.Context, sel ast.SelectionSet, v model.Block) graphql.Marshaler { - return ec._Block(ctx, sel, &v) +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) marshalNBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlock(ctx context.Context, sel ast.SelectionSet, v *model.Block) graphql.Marshaler { +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 { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } return graphql.Null } - return ec._Block(ctx, sel, v) + return ec._Coin(ctx, sel, v) } -func (ec *executionContext) unmarshalNBlockFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockFilter(ctx context.Context, v interface{}) (model.BlockFilter, error) { - res, err := ec.unmarshalInputBlockFilter(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 { + if v == nil { + return graphql.Null + } + return ec._Event(ctx, sel, v) } -func (ec *executionContext) marshalNBlockTransaction2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx context.Context, sel ast.SelectionSet, v []*model.BlockTransaction) graphql.Marshaler { +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 @@ -8661,7 +15971,7 @@ func (ec *executionContext) marshalNBlockTransaction2ᚕᚖgithubᚗcomᚋgnolan if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOBlockTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockTransaction(ctx, sel, v[i]) + ret[i] = ec.marshalOEvent2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx, sel, v[i]) } if isLen1 { f(i) @@ -8675,296 +15985,511 @@ func (ec *executionContext) marshalNBlockTransaction2ᚕᚖgithubᚗcomᚋgnolan return ret } -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) +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) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") +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) 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 + } + 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 + return res, nil } -func (ec *executionContext) marshalNCoin2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐCoin(ctx context.Context, sel ast.SelectionSet, v *model.Coin) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterBlock(ctx context.Context, v interface{}) (*model.FilterBlock, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + 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 graphql.Null } - return ec._Coin(ctx, sel, v) + return res, nil } -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) +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) unmarshalNEventInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInput(ctx context.Context, v interface{}) (*model.EventInput, error) { - res, err := ec.unmarshalInputEventInput(ctx, v) +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) marshalNGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttribute(ctx context.Context, sel ast.SelectionSet, v *model.GnoEventAttribute) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterCoin2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterCoin(ctx context.Context, v interface{}) ([]*model.FilterCoin, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + 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 graphql.Null } - return ec._GnoEventAttribute(ctx, sel, v) + return res, nil } -func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { - res, err := graphql.UnmarshalInt(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 + } + res, err := ec.unmarshalInputFilterCoin(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { - res := graphql.MarshalInt(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") +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 + return res, nil } -func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { - res, err := graphql.UnmarshalInt64(v) - return res, graphql.ErrorOnPath(ctx, err) +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) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { - res := graphql.MarshalInt64(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") +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 + return res, nil } -func (ec *executionContext) marshalNMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFile(ctx context.Context, sel ast.SelectionSet, v *model.MemFile) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterGnoEvent2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEvent(ctx context.Context, v interface{}) (*model.FilterGnoEvent, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null + return nil, nil } - return ec._MemFile(ctx, sel, v) + res, err := ec.unmarshalInputFilterGnoEvent(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNMemPackage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackage(ctx context.Context, sel ast.SelectionSet, v *model.MemPackage) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx context.Context, v interface{}) ([]*model.FilterGnoEventAttribute, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + 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 graphql.Null } - return ec._MemPackage(ctx, sel, v) + return res, nil } -func (ec *executionContext) marshalNMessageValue2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageValue(ctx context.Context, sel ast.SelectionSet, v model.MessageValue) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterGnoEventAttribute(ctx context.Context, v interface{}) (*model.FilterGnoEventAttribute, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null + return nil, nil } - return ec._MessageValue(ctx, sel, v) + res, err := ec.unmarshalInputFilterGnoEventAttribute(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(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) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") +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 + return res, nil } -func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { - res, err := graphql.UnmarshalTime(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 + } + res, err := ec.unmarshalInputFilterMemFile(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { - res := graphql.MarshalTime(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") +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 + return res, nil } -func (ec *executionContext) marshalNTransaction2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransaction(ctx context.Context, sel ast.SelectionSet, v model.Transaction) graphql.Marshaler { - return ec._Transaction(ctx, sel, &v) +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) marshalNTransaction2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransaction(ctx context.Context, sel ast.SelectionSet, v *model.Transaction) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterMessageValue2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMessageValue(ctx context.Context, v interface{}) ([]*model.FilterMessageValue, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + 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 graphql.Null } - return ec._Transaction(ctx, sel, v) + return res, nil } -func (ec *executionContext) unmarshalNTransactionFilter2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionFilter(ctx context.Context, v interface{}) (model.TransactionFilter, error) { - res, err := ec.unmarshalInputTransactionFilter(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 + } + res, err := ec.unmarshalInputFilterMessageValue(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -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 - if !isLen1 { - wg.Add(len(v)) +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 } - 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.marshalOTransactionMessage2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessage(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) + 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 } - } - wg.Wait() - - return ret + return res, nil } -func (ec *executionContext) unmarshalNTransactionMessageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionMessageInput(ctx context.Context, v interface{}) (*model.TransactionMessageInput, error) { - res, err := ec.unmarshalInputTransactionMessageInput(ctx, v) +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) marshalNTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTransactionResponse(ctx context.Context, sel ast.SelectionSet, v *model.TransactionResponse) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterMsgCall2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx context.Context, v interface{}) ([]*model.FilterMsgCall, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + 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 graphql.Null } - return ec._TransactionResponse(ctx, sel, v) + return res, nil } -func (ec *executionContext) marshalNTxFee2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐTxFee(ctx context.Context, sel ast.SelectionSet, v *model.TxFee) graphql.Marshaler { +func (ec *executionContext) unmarshalOFilterMsgCall2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterMsgCall(ctx context.Context, v interface{}) (*model.FilterMsgCall, error) { if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + 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 graphql.Null } - return ec._TxFee(ctx, sel, v) + return res, nil } -func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { - return ec.___Directive(ctx, sel, &v) +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.unmarshalInputFilterMsgRun(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -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 - if !isLen1 { - wg.Add(len(v)) +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 } - 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.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } + 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 } - wg.Wait() + res, err := ec.unmarshalInputFilterTime(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - 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 + } + 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 } } - - return ret + return res, nil } -func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(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 + } + res, err := ec.unmarshalInputFilterTransaction(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") +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 + } + 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 + return res, nil } -func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { +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) 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([]string, len(vSlice)) + res := make([]*model.FilterTransactionResponse, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + res[i], err = ec.unmarshalOFilterTransactionResponse2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterTransactionResponse(ctx, vSlice[i]) if err != nil { return nil, err } @@ -8972,63 +16497,94 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte return res, nil } -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 - if !isLen1 { - wg.Add(len(v)) +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 } - 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.marshalN__DirectiveLocation2string(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } + res, err := ec.unmarshalInputFilterTransactionResponse(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} +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 } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null + 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 +} - return ret +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) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { - return ec.___EnumValue(ctx, sel, &v) +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 + } + } + return res, nil } -func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { - return ec.___Field(ctx, sel, &v) +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.unmarshalInputFilterUnknownEvent(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { - return ec.___InputValue(ctx, sel, &v) +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 + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]model.FilterableExtra, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFilterableExtra2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtra(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) 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 + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -9052,7 +16608,7 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + ret[i] = ec.marshalNFilterableExtra2githubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐFilterableExtra(ctx, sel, v[i]) } if isLen1 { f(i) @@ -9072,11 +16628,10 @@ func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋg return ret } -func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { - return ec.___Type(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalOGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttributeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GnoEventAttribute) graphql.Marshaler { + if v == nil { + return graphql.Null + } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -9100,7 +16655,7 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + ret[i] = ec.marshalNGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttribute(ctx, sel, v[i]) } if isLen1 { f(i) @@ -9120,48 +16675,23 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen return ret } -func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalOAmountInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐAmountInput(ctx context.Context, v interface{}) (*model.AmountInput, error) { +func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputAmountInput(ctx, v) + res, err := graphql.UnmarshalInt(v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOBankMsgSendInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBankMsgSendInput(ctx context.Context, v interface{}) (*model.BankMsgSendInput, error) { +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { if v == nil { - return nil, nil + return graphql.Null } - res, err := ec.unmarshalInputBankMsgSendInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + res := graphql.MarshalInt(*v) + return res } -func (ec *executionContext) marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlockᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Block) graphql.Marshaler { +func (ec *executionContext) marshalOMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.MemFile) graphql.Marshaler { if v == nil { return graphql.Null } @@ -9188,7 +16718,7 @@ func (ec *executionContext) marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑin if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNBlock2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐBlock(ctx, sel, v[i]) + ret[i] = ec.marshalNMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFile(ctx, sel, v[i]) } if isLen1 { f(i) @@ -9208,95 +16738,239 @@ func (ec *executionContext) marshalOBlock2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑin 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 { +func (ec *executionContext) unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx context.Context, v interface{}) ([]*model.MemFileInput, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.MemFileInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOMemFileInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOMemFileInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx context.Context, v interface{}) (*model.MemFileInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputMemFileInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx context.Context, v interface{}) (*model.MemPackageInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputMemPackageInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOMessageRoute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageRoute(ctx context.Context, v interface{}) (*model.MessageRoute, error) { + if v == nil { + return nil, nil + } + var res = new(model.MessageRoute) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOMessageRoute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageRoute(ctx context.Context, sel ast.SelectionSet, v *model.MessageRoute) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._BlockTransaction(ctx, sel, v) + return v } -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) +func (ec *executionContext) unmarshalOMessageType2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageType(ctx context.Context, v interface{}) (*model.MessageType, error) { + if v == nil { + return nil, nil + } + var res = new(model.MessageType) + err := res.UnmarshalGQL(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) marshalOMessageType2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageType(ctx context.Context, sel ast.SelectionSet, v *model.MessageType) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v } -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { +func (ec *executionContext) unmarshalOMsgAddPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgAddPackageInput(ctx context.Context, v interface{}) (*model.MsgAddPackageInput, error) { if v == nil { return nil, nil } - res, err := graphql.UnmarshalBoolean(v) + res, err := ec.unmarshalInputMsgAddPackageInput(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) unmarshalOMsgCallInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgCallInput(ctx context.Context, v interface{}) (*model.MsgCallInput, error) { if v == nil { - return graphql.Null + return nil, nil } - res := graphql.MarshalBoolean(*v) - return res + res, err := ec.unmarshalInputMsgCallInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -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) unmarshalOMsgRunInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgRunInput(ctx context.Context, v interface{}) (*model.MsgRunInput, error) { if v == nil { - return graphql.Null + return nil, nil } - return ec._Coin(ctx, sel, v) + res, err := ec.unmarshalInputMsgRunInput(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) unmarshalONestedFilterBankMsgSend2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterBankMsgSend(ctx context.Context, v interface{}) ([]*model.NestedFilterBankMsgSend, 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.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) marshalOEvent2ᚕgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEvent(ctx context.Context, sel ast.SelectionSet, v []model.Event) graphql.Marshaler { +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 graphql.Null + return nil, nil } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) + 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 } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], + 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 } - 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]) + } + 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 } - if isLen1 { - f(i) - } else { - go f(i) + } + 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) 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 } - } - wg.Wait() + return res, nil +} - return ret +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) unmarshalOEventAttributeInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventAttributeInputᚄ(ctx context.Context, v interface{}) ([]*model.EventAttributeInput, error) { +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 } @@ -9305,10 +16979,10 @@ func (ec *executionContext) unmarshalOEventAttributeInput2ᚕᚖgithubᚗcomᚋg vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.EventAttributeInput, len(vSlice)) + res := make([]*model.NestedFilterGnoEventAttribute, 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]) + res[i], err = ec.unmarshalONestedFilterGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterGnoEventAttribute(ctx, vSlice[i]) if err != nil { return nil, err } @@ -9316,7 +16990,15 @@ func (ec *executionContext) unmarshalOEventAttributeInput2ᚕᚖgithubᚗcomᚋg return res, nil } -func (ec *executionContext) unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐEventInputᚄ(ctx context.Context, v interface{}) ([]*model.EventInput, error) { +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 } @@ -9325,10 +17007,10 @@ func (ec *executionContext) unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋ vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.EventInput, len(vSlice)) + res := make([]*model.NestedFilterMemFile, 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]) + res[i], err = ec.unmarshalONestedFilterMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMemFile(ctx, vSlice[i]) if err != nil { return nil, err } @@ -9336,117 +17018,127 @@ func (ec *executionContext) unmarshalOEventInput2ᚕᚖgithubᚗcomᚋgnolangᚋ return res, nil } -func (ec *executionContext) marshalOGnoEventAttribute2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttributeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GnoEventAttribute) graphql.Marshaler { +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 graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) + return nil, nil } - 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.marshalNGnoEventAttribute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐGnoEventAttribute(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } + 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 } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null + 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 ret + return res, nil } -func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { +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 := graphql.UnmarshalInt(v) + res, err := ec.unmarshalInputNestedFilterMemPackage(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { +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 graphql.Null + return nil, nil } - res := graphql.MarshalInt(*v) - return res + 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) marshalOMemFile2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.MemFile) graphql.Marshaler { +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 graphql.Null + return nil, nil } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) + 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 } - 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.marshalNMemFile2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFile(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) + 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 } - wg.Wait() + res, err := ec.unmarshalInputNestedFilterMsgAddPackage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} - for _, e := range ret { - if e == graphql.Null { - return graphql.Null +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 +} - return ret +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) unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx context.Context, v interface{}) ([]*model.MemFileInput, error) { +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 } @@ -9455,10 +17147,10 @@ func (ec *executionContext) unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolang vSlice = graphql.CoerceList(v) } var err error - res := make([]*model.MemFileInput, len(vSlice)) + res := make([]*model.NestedFilterMsgRun, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOMemFileInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalONestedFilterMsgRun2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐNestedFilterMsgRun(ctx, vSlice[i]) if err != nil { return nil, err } @@ -9466,75 +17158,123 @@ func (ec *executionContext) unmarshalOMemFileInput2ᚕᚖgithubᚗcomᚋgnolang return res, nil } -func (ec *executionContext) unmarshalOMemFileInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemFileInput(ctx context.Context, v interface{}) (*model.MemFileInput, error) { +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.unmarshalInputMemFileInput(ctx, v) + res, err := ec.unmarshalInputNestedFilterMsgRun(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOMemPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMemPackageInput(ctx context.Context, v interface{}) (*model.MemPackageInput, error) { +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.unmarshalInputMemPackageInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + 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) unmarshalOMessageRoute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageRoute(ctx context.Context, v interface{}) (*model.MessageRoute, error) { +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 res = new(model.MessageRoute) - err := res.UnmarshalGQL(v) - return res, graphql.ErrorOnPath(ctx, err) + res, err := ec.unmarshalInputNestedFilterTransactionMessage(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOMessageRoute2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageRoute(ctx context.Context, sel ast.SelectionSet, v *model.MessageRoute) graphql.Marshaler { +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 graphql.Null + return nil, nil } - return v + 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) unmarshalOMessageType2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageType(ctx context.Context, v interface{}) (*model.MessageType, error) { +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 res = new(model.MessageType) - err := res.UnmarshalGQL(v) - return res, graphql.ErrorOnPath(ctx, err) + res, err := ec.unmarshalInputNestedFilterTransactionResponse(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOMessageType2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMessageType(ctx context.Context, sel ast.SelectionSet, v *model.MessageType) graphql.Marshaler { +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 graphql.Null + return nil, nil } - return v + 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) unmarshalOMsgAddPackageInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgAddPackageInput(ctx context.Context, v interface{}) (*model.MsgAddPackageInput, error) { +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.unmarshalInputMsgAddPackageInput(ctx, v) + res, err := ec.unmarshalInputNestedFilterTxFee(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOMsgCallInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgCallInput(ctx context.Context, v interface{}) (*model.MsgCallInput, error) { +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.unmarshalInputMsgCallInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + 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) unmarshalOMsgRunInput2ᚖgithubᚗcomᚋgnolangᚋtxᚑindexerᚋserveᚋgraphᚋmodelᚐMsgRunInput(ctx context.Context, v interface{}) (*model.MsgRunInput, error) { +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.unmarshalInputMsgRunInput(ctx, v) + res, err := ec.unmarshalInputNestedFilterUnknownEvent(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } diff --git a/serve/graph/model/filter_methods_gen.go b/serve/graph/model/filter_methods_gen.go new file mode 100644 index 00000000..9f1b2131 --- /dev/null +++ b/serve/graph/model/filter_methods_gen.go @@ -0,0 +1,2378 @@ +// 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 { + elemMatchEvents := false + for _, elem := range obj.Events() { + if f.Events.Eval(&elem) { + elemMatchEvents = true + } + } + + if !elemMatchEvents { + 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 { + elemMatchArgs := false + for _, elem := range obj.Args { + if f.Args.Eval(&elem) { + elemMatchArgs = true + } + } + + if !elemMatchArgs { + 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 + + // Check if any filters are specified + filtersSpecified := f.BankMsgSend != nil || f.MsgCall != nil || f.MsgAddPackage != nil || f.MsgRun != 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.(BankMsgSend); ok { + matchedType = true + 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 true + } + } + + if uObj, ok := tobj.(MsgAddPackage); ok { + matchedType = true + 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 true + } + } + + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + 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 { + elemMatchFiles := false + for _, elem := range obj.Files { + if f.Files.Eval(elem) { + elemMatchFiles = true + } + } + + if !elemMatchFiles { + 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 { + elemMatchAttrs := false + for _, elem := range obj.Attrs { + if f.Attrs.Eval(elem) { + elemMatchAttrs = true + } + } + + if !elemMatchAttrs { + 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 + + // 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 true + } + } + + if uObj, ok := tobj.(UnknownEvent); ok { + matchedType = true + if f.UnknownEvent != nil && f.UnknownEvent.Eval(&uObj) { + return true + } + } + + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + 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 { + elemMatchEvents := false + for _, elem := range obj.Events() { + if f.Events.Eval(&elem) { + elemMatchEvents = true + } + } + + if !elemMatchEvents { + 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 { + elemMatchMessages := false + for _, elem := range obj.Messages() { + if f.Messages.Eval(elem) { + elemMatchMessages = true + } + } + + if !elemMatchMessages { + 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 { + elemMatchArgs := false + for _, elem := range obj.Args { + if f.Args.Eval(&elem) { + elemMatchArgs = true + } + } + + if !elemMatchArgs { + 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 + + // Check if any filters are specified + filtersSpecified := f.BankMsgSend != nil || f.MsgCall != nil || f.MsgAddPackage != nil || f.MsgRun != 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.(BankMsgSend); ok { + matchedType = true + 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 true + } + } + + if uObj, ok := tobj.(MsgAddPackage); ok { + matchedType = true + 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 true + } + } + + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + 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 { + elemMatchFiles := false + for _, elem := range obj.Files { + if f.Files.Eval(elem) { + elemMatchFiles = true + } + } + + if !elemMatchFiles { + 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 { + elemMatchAttrs := false + for _, elem := range obj.Attrs { + if f.Attrs.Eval(elem) { + elemMatchAttrs = true + } + } + + if !elemMatchAttrs { + 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 + + // 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 true + } + } + + if uObj, ok := tobj.(UnknownEvent); ok { + matchedType = true + if f.UnknownEvent != nil && f.UnknownEvent.Eval(&uObj) { + return true + } + } + + // If the object is of a type specified in filters but didn't match, return false. + if matchedType { + 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 { + elemMatchTxs := false + for _, elem := range obj.Txs() { + if f.Txs.Eval(elem) { + elemMatchTxs = true + } + } + + if !elemMatchTxs { + 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) +} + +func (f *FilterInt) Eval(val *int) bool { + if f == nil { + return true + } + + if !rootEval(val, f.Exists, f.Eq) { + 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) { + return false + } + + if val != nil && f.Like != nil { + matched, err := regexp.MatchString(*f.Like, *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) { + 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) 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 + } + + return true +} diff --git a/serve/graph/model/models_gen.go b/serve/graph/model/models_gen.go index 7f5010fa..66e24e1b 100644 --- a/serve/graph/model/models_gen.go +++ b/serve/graph/model/models_gen.go @@ -117,6 +117,376 @@ 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. + 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 *FilterInt `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 *FilterInt `json:"num_txs,omitempty"` + // filter for total_txs field. + TotalTxs *FilterInt `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 *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 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. + Eq *int `json:"eq,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 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. + 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 like the specified value. You can use standard Go RegEx expressions here. + Like *string `json:"like,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 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 *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 *FilterInt `json:"block_height,omitempty"` + // filter for gas_wanted field. + GasWanted *FilterInt `json:"gas_wanted,omitempty"` + // filter for gas_used field. + GasUsed *FilterInt `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 value field. + Value *NestedFilterMessageValue `json:"value,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 events field. + Events *NestedFilterEvent `json:"events,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 *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 { @@ -272,6 +642,260 @@ 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. + 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 *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. + 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 value field. + Value *NestedFilterMessageValue `json:"value,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 events field. + Events *NestedFilterEvent `json:"events,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 *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 { } @@ -375,6 +999,47 @@ type UnknownEvent struct { func (UnknownEvent) IsEvent() {} +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. + FilterableExtraMinmax FilterableExtra = "MINMAX" +) + +var AllFilterableExtra = []FilterableExtra{ + FilterableExtraMinmax, +} + +func (e FilterableExtra) IsValid() bool { + switch e { + case FilterableExtraMinmax: + return true + } + return false +} + +func (e FilterableExtra) String() string { + return string(e) +} + +func (e *FilterableExtra) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = FilterableExtra(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid FilterableExtra", str) + } + return nil +} + +func (e FilterableExtra) 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/playground.go b/serve/graph/playground.go new file mode 100644 index 00000000..4a4e7743 --- /dev/null +++ b/serve/graph/playground.go @@ -0,0 +1,140 @@ +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, _ *http.Request) { + w.Header().Add("Content-Type", "text/html; charset=UTF-8") + + if 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=", + }); 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/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..ad31ac07 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,19 +107,19 @@ 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. `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 } """ @@ -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,27 +307,27 @@ 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. """ - 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 00cdd324..57697c67 100644 --- a/serve/graph/setup.go +++ b/serve/graph/setup.go @@ -1,24 +1,70 @@ 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" + "github.com/gnolang/tx-indexer/serve/graph/model" "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{Resolvers: NewResolver(s, manager)}, + Config{ + Resolvers: NewResolver(s, manager), + Directives: DirectiveRoot{ + Filterable: func( + ctx context.Context, + _ interface{}, + next graphql.Resolver, + _ []model.FilterableExtra, + ) (interface{}, error) { + return next(ctx) + }, + }, + }, )) 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 +} 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 } 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" )