Skip to content

Commit

Permalink
Merge pull request #299 from bmeg/feature/client-additions
Browse files Browse the repository at this point in the history
adds additional gripql/client functions
  • Loading branch information
kellrott authored Nov 2, 2023
2 parents b0bb9c6 + 88b5e6a commit fa720cf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions gripql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,32 @@ func (client Client) GetSchema(graph string) (*Graph, error) {
}

// SampleSchema asks server to scan data to determine possible schema
func (client Client) SampleSchema(graph string) (*Graph, error) {
func (client Client) SampleSchema(graph string) (*Graph, error) {
out, err := client.EditC.SampleSchema(context.Background(), &GraphID{Graph: graph})
return out, err
}


// AddSchema adds a schema for a graph.
func (client Client) AddSchema(graph *Graph) error {
_, err := client.EditC.AddSchema(context.Background(), graph)
return err
}

func (client Client) DeleteEdge(graph string, id string) error {
_, err := client.EditC.DeleteEdge(context.Background(), &ElementID{Graph: graph, Id: id})
return err
}

func (client Client) DeleteVertex(graph string, id string) error {
_, err := client.EditC.DeleteVertex(context.Background(), &ElementID{Graph: graph, Id: id})
return err
}

func (client Client) GetEdge(graph string, id string) (*Edge, error) {
e, err := client.QueryC.GetEdge(context.Background(), &ElementID{Graph: graph, Id: id})
return e, err
}

// GetMaping returns the mapping for the given graph.
func (client Client) GetMapping(graph string) (*Graph, error) {
return client.QueryC.GetMapping(context.Background(), &GraphID{Graph: graph})
Expand Down

0 comments on commit fa720cf

Please sign in to comment.