Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Add language support for Hypermode Go SDK [#317](https://github.com/hypermodeAI/runtime/pull/317) [#351](https://github.com/hypermodeAI/runtime/pull/351) [#352](https://github.com/hypermodeAI/runtime/pull/352)
- Major refactoring to support multiple guest languages [#347](https://github.com/hypermodeAI/runtime/pull/347)
- Rename `hmruntime` to `hypruntime` [#348](https://github.com/hypermodeAI/runtime/pull/348)
- Make empty dgraph responses nil [#355](https://github.com/hypermodeAI/runtime/pull/355)

## 2024-08-27 - Version 0.11.2

Expand Down
7 changes: 4 additions & 3 deletions dgraphclient/dgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package dgraphclient

import (
"context"
"fmt"
"hypruntime/logger"

"github.com/dgraph-io/dgo/v230"
Expand Down Expand Up @@ -48,7 +49,7 @@ func (dc *dgraphConnector) dropAll(ctx context.Context) (string, error) {
func (dc *dgraphConnector) execute(ctx context.Context, req *Request) (*Response, error) {
if len(req.Mutations) == 0 {
if req.Query.Query == "" {
return &Response{}, nil
return nil, fmt.Errorf("no query or mutations provided")
}

tx := dc.dgClient.NewReadOnlyTxn()
Expand All @@ -68,7 +69,7 @@ func (dc *dgraphConnector) execute(ctx context.Context, req *Request) (*Response

resp, err := tx.Do(ctx, dgoReq)
if err != nil {
return &Response{}, err
return nil, err
}

return &Response{Json: string(resp.Json), Uids: resp.Uids}, nil
Expand Down Expand Up @@ -118,7 +119,7 @@ func (dc *dgraphConnector) execute(ctx context.Context, req *Request) (*Response

resp, err := tx.Do(ctx, dgoReq)
if err != nil {
return &Response{}, err
return nil, err
}

return &Response{Json: string(resp.Json), Uids: resp.Uids}, nil
Expand Down
2 changes: 1 addition & 1 deletion dgraphclient/dgraphclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Initialize() {
func Execute(ctx context.Context, hostName string, req *Request) (*Response, error) {
dc, err := dgr.getDgraphConnector(ctx, hostName)
if err != nil {
return &Response{}, err
return nil, err
}

return dc.execute(ctx, req)
Expand Down