Skip to content

Commit

Permalink
feat: add AppConnection and AppEdge types, and implement GetApplicati…
Browse files Browse the repository at this point in the history
…ons method in AdapterV1
  • Loading branch information
sandhilt committed Feb 6, 2025
1 parent 2f857f9 commit fca9145
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 36 deletions.
5 changes: 5 additions & 0 deletions pkg/reader/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,9 @@ type Adapter interface {
ctx context.Context,
inputIndex *int,
) (*graphql.Connection[*graphql.Notice], error)

GetApplications(
ctx context.Context,
first *int, last *int, after *string, before *string, filter *graphql.AppFilter,
) (*graphql.AppConnection, error)
}
5 changes: 5 additions & 0 deletions pkg/reader/adapter_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ type AdapterV1 struct {
convenienceService *services.ConvenienceService
}

// GetApplications implements Adapter.
func (a *AdapterV1) GetApplications(ctx context.Context, first *int, last *int, after *string, before *string, filter *graphql.AppFilter) (*graphql.AppConnection, error) {
panic("unimplemented")
}

func NewAdapterV1(
db *sqlx.DB,
convenienceService *services.ConvenienceService,
Expand Down
6 changes: 6 additions & 0 deletions pkg/reader/gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ models:
ReportEdge:
model:
- github.com/cartesi/rollups-graphql/pkg/reader/model.ReportEdge
AppConnection:
model:
- github.com/cartesi/rollups-graphql/pkg/reader/model.AppConnection
AppEdge:
model:
- github.com/cartesi/rollups-graphql/pkg/reader/model.AppEdge
38 changes: 19 additions & 19 deletions pkg/reader/graph/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions pkg/reader/model/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/reader/model/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,6 @@ type NoticeEdge = Edge[*Notice]

type ReportConnection = Connection[*Report]
type ReportEdge = Edge[*Report]

type AppConnection = Connection[*Application]
type AppEdge = Edge[*Application]
2 changes: 1 addition & 1 deletion pkg/reader/reader.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fca9145

Please sign in to comment.