Module: Dgraph

Defined in:
lib/dgraph.rb,
lib/dgraph/version.rb

Overview

D-graph ruby driver

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.mutate(query_string) ⇒ Object



9
10
11
# File 'lib/dgraph.rb', line 9

def self.mutate(query_string)
  stub.mutate(Api::Mutation.new(set_json: query_string, commit_now: true))
end

.query(query_string, vars = {}) ⇒ Object



13
14
15
# File 'lib/dgraph.rb', line 13

def self.query(query_string, vars = {})
  stub.query(Api::Request.new(query: query_string, vars: vars))
end

.stubObject



17
18
19
# File 'lib/dgraph.rb', line 17

def self.stub
  @stub ||= Api::Dgraph::Stub.new('localhost:9080', :this_channel_is_insecure)
end