aboutsummaryrefslogtreecommitdiffstats
path: root/graphql2/resolvers.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-29 18:11:33 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-29 18:51:56 +0200
commit6363518c85cbd8247a5f6507b8a1dd3903cfb71d (patch)
treeaa51652e9881196b3637247988cbd5155f42b5e2 /graphql2/resolvers.go
parentff2fd14e3f10a7206d4ec86f07e524cfa290e0fc (diff)
downloadgit-bug-6363518c85cbd8247a5f6507b8a1dd3903cfb71d.tar.gz
relay connection working with gqlgen
Diffstat (limited to 'graphql2/resolvers.go')
-rw-r--r--graphql2/resolvers.go82
1 files changed, 0 insertions, 82 deletions
diff --git a/graphql2/resolvers.go b/graphql2/resolvers.go
deleted file mode 100644
index fa47f222..00000000
--- a/graphql2/resolvers.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package graphql2
-
-import (
- "context"
- "fmt"
- "github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/bug/operations"
- "github.com/MichaelMure/git-bug/cache"
- "github.com/MichaelMure/git-bug/graphql2/gen"
- "time"
-)
-
-type Backend struct {
- cache cache.RootCache
-}
-
-func (*Backend) Bug_labels(ctx context.Context, obj *bug.Snapshot) ([]*bug.Label, error) {
- return obj.Labels
-}
-
-func (*Backend) LabelChangeOperation_added(ctx context.Context, obj *operations.LabelChangeOperation) ([]*bug.Label, error) {
- panic("implement me")
-}
-
-func (*Backend) LabelChangeOperation_removed(ctx context.Context, obj *operations.LabelChangeOperation) ([]*bug.Label, error) {
- panic("implement me")
-}
-
-func (*Backend) AddCommentOperation_date(ctx context.Context, obj *operations.AddCommentOperation) (time.Time, error) {
- return obj.Time(), nil
-}
-
-func (*Backend) Bug_status(ctx context.Context, obj *bug.Snapshot) (gen.Status, error) {
- return convertStatus(obj.Status)
-}
-
-func (*Backend) Bug_comments(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int, query *string) (gen.CommentConnection, error) {
- panic("implement me")
-}
-
-func (*Backend) Bug_operations(ctx context.Context, obj *bug.Snapshot, after *string, before *string, first *int, last *int, query *string) (gen.OperationConnection, error) {
- panic("implement me")
-}
-
-func (*Backend) CreateOperation_date(ctx context.Context, obj *operations.CreateOperation) (time.Time, error) {
- return obj.Time(), nil
-}
-
-func (*Backend) LabelChangeOperation_date(ctx context.Context, obj *operations.LabelChangeOperation) (time.Time, error) {
- return obj.Time(), nil
-}
-
-func (*Backend) RootQuery_allBugs(ctx context.Context, after *string, before *string, first *int, last *int, query *string) (gen.BugConnection, error) {
- panic("implement me")
-}
-
-func (*Backend) RootQuery_bug(ctx context.Context, id string) (*bug.Snapshot, error) {
- panic("implement me")
-}
-
-func (*Backend) SetStatusOperation_date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error) {
- return obj.Time(), nil
-}
-
-func (*Backend) SetStatusOperation_status(ctx context.Context, obj *operations.SetStatusOperation) (gen.Status, error) {
- return convertStatus(obj.Status)
-}
-
-func (*Backend) SetTitleOperation_date(ctx context.Context, obj *operations.SetTitleOperation) (time.Time, error) {
- return obj.Time(), nil
-}
-
-func convertStatus(status bug.Status) (gen.Status, error) {
- switch status {
- case bug.OpenStatus:
- return gen.StatusOpen, nil
- case bug.ClosedStatus:
- return gen.StatusClosed, nil
- }
-
- return "", fmt.Errorf("Unknown status")
-}