Skip to content

Commit

Permalink
Adding ability to write to plugin endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
kellrott committed Oct 24, 2023
1 parent 44878a8 commit d56781c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d56781c

Please sign in to comment.