Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrakos committed Nov 14, 2024
1 parent 9f1af8e commit 2ecd5c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/gqlclient/gqlclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ func (c *Client) runWithFiles(ctx context.Context, gqlReq RequestWithFiles, resp
return errors.Wrap(err, "decoding response")
}

// If the response is a single object, meaning we only have a single query in the request, we can unmarshal the
// response directly to the response type. Otherwise, we need to marshal the response as we normally would.
if len(intermediateResp) == 1 {
for _, val := range intermediateResp {
data, err := json.Marshal(val)
Expand Down

0 comments on commit 2ecd5c7

Please sign in to comment.