Skip to content

Commit

Permalink
get check throws graphql error when not found
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbloss committed Oct 21, 2024
1 parent 50cce36 commit acf209b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion check.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/mitchellh/mapstructure"

"github.com/hasura/go-graphql-client"
"github.com/relvacode/iso8601"
)

Expand Down Expand Up @@ -186,7 +187,10 @@ func (client *Client) GetCheck(id ID) (*Check, error) {
}
err := client.Query(&q, v, WithName("CheckGet"))
if q.Account.Check.Id == "" {
err = fmt.Errorf("check with ID '%s' not found", id)
err = graphql.Errors{graphql.Error{
Message: fmt.Sprintf("check with ID '%s' not found", id),
Path: []any{"account", "check"},
}}
}
return &q.Account.Check, HandleErrors(err, nil)
}
Expand Down

0 comments on commit acf209b

Please sign in to comment.