diff --git a/server/server.go b/server/server.go index 041f6b05..a693efa7 100644 --- a/server/server.go +++ b/server/server.go @@ -218,11 +218,18 @@ func (server *GripServer) Serve(pctx context.Context) error { */ for name, setup := range endpointMap { - handler, err := setup(gripql.WrapClient(gripql.NewQueryDirectClient( + queryClient := gripql.NewQueryDirectClient( server, gripql.DirectUnaryInterceptor(unaryAuthInt), gripql.DirectStreamInterceptor(streamAuthInt), - ), nil, nil, nil)) + ) + // TODO: make writeClient initialization configurable + writeClient := gripql.NewEditDirectClient( + server, + gripql.DirectUnaryInterceptor(unaryAuthInt), + gripql.DirectStreamInterceptor(streamAuthInt), + ) + handler, err := setup(gripql.WrapClient(queryClient, writeClient, nil, nil)) if err == nil { log.Infof("Plugin added to /%s/", name) prefix := fmt.Sprintf("/%s/", name)