Skip to content

Commit

Permalink
add GqlContext helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Norton committed Dec 25, 2023
1 parent df50569 commit 00eff24
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions policy/data/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package data

import (
"context"
"github.com/atomist-skills/go-skill"
)

type QueryResponse struct {
Expand All @@ -12,3 +13,10 @@ type QueryResponse struct {
type DataSource interface {
Query(ctx context.Context, queryName string, query string, variables map[string]interface{}) (*QueryResponse, error)
}

func GqlContext(req skill.RequestContext) map[string]interface{} {
return map[string]interface{}{
"teamId": req.Event.WorkspaceId,
"organization": req.Event.Organization,
}
}

0 comments on commit 00eff24

Please sign in to comment.