aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers/mutation.go
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2020-06-18 02:52:33 +0100
committerMichael Muré <batolettre@gmail.com>2020-06-27 22:56:10 +0200
commit4a28f25347addf05708cdff37ecace4139f01779 (patch)
tree145e5fd420f70b182d66a5824d76300b5307d509 /graphql/resolvers/mutation.go
parent23228101a2a38a139f6fc2cafc18e9f08d911089 (diff)
downloadgit-bug-4a28f25347addf05708cdff37ecace4139f01779.tar.gz
Add support for read-only mode for web UI.
Fixes #402.
Diffstat (limited to 'graphql/resolvers/mutation.go')
-rw-r--r--graphql/resolvers/mutation.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/graphql/resolvers/mutation.go b/graphql/resolvers/mutation.go
index 850645f4..80d6fb1a 100644
--- a/graphql/resolvers/mutation.go
+++ b/graphql/resolvers/mutation.go
@@ -7,8 +7,32 @@ import (
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/graphql/graph"
"github.com/MichaelMure/git-bug/graphql/models"
+ "github.com/vektah/gqlparser/gqlerror"
)
+var _ graph.MutationResolver = &readonlyMutationResolver{}
+
+type readonlyMutationResolver struct{}
+
+func (readonlyMutationResolver) NewBug(_ context.Context, _ models.NewBugInput) (*models.NewBugPayload, error) {
+ return nil, gqlerror.Errorf("readonly mode")
+}
+func (readonlyMutationResolver) AddComment(_ context.Context, input models.AddCommentInput) (*models.AddCommentPayload, error) {
+ return nil, gqlerror.Errorf("readonly mode")
+}
+func (readonlyMutationResolver) ChangeLabels(_ context.Context, input *models.ChangeLabelInput) (*models.ChangeLabelPayload, error) {
+ return nil, gqlerror.Errorf("readonly mode")
+}
+func (readonlyMutationResolver) OpenBug(_ context.Context, input models.OpenBugInput) (*models.OpenBugPayload, error) {
+ return nil, gqlerror.Errorf("readonly mode")
+}
+func (readonlyMutationResolver) CloseBug(_ context.Context, input models.CloseBugInput) (*models.CloseBugPayload, error) {
+ return nil, gqlerror.Errorf("readonly mode")
+}
+func (readonlyMutationResolver) SetTitle(_ context.Context, input models.SetTitleInput) (*models.SetTitlePayload, error) {
+ return nil, gqlerror.Errorf("readonly mode")
+}
+
var _ graph.MutationResolver = &mutationResolver{}
type mutationResolver struct {