Class: GraphQL::Repl

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/repl.rb

Instance Method Summary collapse

Constructor Details

#initialize(schema) ⇒ Repl

Returns a new instance of Repl.


3
4
5
# File 'lib/graphql/repl.rb', line 3

def initialize(schema)
  @schema = schema
end

Instance Method Details

#runObject


7
8
9
10
11
12
13
14
15
# File 'lib/graphql/repl.rb', line 7

def run
  puts "Starting a repl for schema (type 'quit' to exit)"
  while line = gets do
    if line == "quit\n"
      exit
    end
    execute_query(line)
  end
end