-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathquery_examples.rb
21 lines (17 loc) · 968 Bytes
/
query_examples.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ! The following examples are used together with
# ! https://github.com/sushie1984/rails-graphql-server
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
uri = 'http://rails-graphql-server.herokuapp.com/api/graphql'
GraphqlConnector.configure do |config|
config.add_server(name: 'RailsGraphqlServer', uri: uri, headers: {})
end
GraphqlConnector::RailsGraphqlServer.query('departments',
{},
['id', 'name',
'employees' => ['yearlySalary']])
GraphqlConnector::RailsGraphqlServer.query('departments',
{ id: %w[1 2] },
['id', 'name',
'employees' => ['yearlySalary']])