Sha256: 44dc9c547e7b7abff8278d96eee28f2cba3e720ca8db81b2cd97877856ed4a65

Contents?: true

Size: 795 Bytes

Versions: 6

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ! The following examples are used together with
# ! https://github.com/sushie1984/rails-graphql-server
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

GraphqlConnector.configure do |config|
  config.add_server(name: 'RailsGraphqlServer',
                    uri: 'http://rails-graphql-server.herokuapp.com/api/graphql',
                    headers: {})
end

GraphqlConnector::RailsGraphqlServer.raw_query(
  'query { departments { id name employees { yearlySalary } } }'
)

GraphqlConnector::RailsGraphqlServer.raw_query(
  'query departments($id: [ID!]) {
    departments(id: $id) { name employees { name }
    }
  }',
  variables: { id: %w[1 2] }
)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
graphql_connector-2.0.0 examples/raw_query_examples.rb
graphql_connector-1.4.0 examples/raw_query_examples.rb
graphql_connector-1.3.1 examples/raw_query_examples.rb
graphql_connector-1.3.0 examples/raw_query_examples.rb
graphql_connector-1.2.1 examples/raw_query_examples.rb
graphql_connector-1.2.0 examples/raw_query_examples.rb