Sha256: 5c13cb2dbbbfc66f37f0c9531310a0fea0358c1cc065b37fd3a51f0f448c4340

Contents?: true

Size: 501 Bytes

Versions: 13

Compression:

Stored size: 501 Bytes

Contents

# frozen_string_literal: true

require 'rackup'
require 'json'
require 'graphql'
require_relative './helpers'

class RemoteApp
  def call(env)
    params = apollo_upload_server_middleware_params(env)
    result = RemoteSchema.execute(
      query: params["query"],
      variables: params["variables"],
      operation_name: params["operationName"],
    )

    [200, {"content-type" => "application/json"}, [JSON.generate(result)]]
  end
end

Rackup::Handler.default.run(RemoteApp.new, :Port => 3001)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
graphql-stitching-1.5.1 examples/file_uploads/remote.rb
graphql-stitching-1.5.0 examples/file_uploads/remote.rb
graphql-stitching-1.4.3 examples/file_uploads/remote.rb
graphql-stitching-1.4.2 examples/file_uploads/remote.rb
graphql-stitching-1.4.1 examples/file_uploads/remote.rb
graphql-stitching-1.4.0 examples/file_uploads/remote.rb
graphql-stitching-1.3.0 examples/file_uploads/remote.rb
graphql-stitching-1.2.5 examples/file_uploads/remote.rb
graphql-stitching-1.2.4 examples/file_uploads/remote.rb
graphql-stitching-1.2.3 examples/file_uploads/remote.rb
graphql-stitching-1.2.2 examples/file_uploads/remote.rb
graphql-stitching-1.2.1 examples/file_uploads/remote.rb
graphql-stitching-1.2.0 examples/file_uploads/remote.rb