Sha256: c18591c7395cfe79dcd3217b1c72697e52b9859b9e99bc7327d6832ed6fccf1f

Contents?: true

Size: 521 Bytes

Versions: 3

Compression:

Stored size: 521 Bytes

Contents

require 'spec_helper'

describe GraphQL::Query::OperationResolver do
  let(:operation) { GraphQL.parse("query getCheese($cheeseId: Int!) { cheese(id: $cheeseId) { name }}", as: :operation_definition) }
  let(:params) { {"cheeseId" => 1}}
  let(:query) { q = Minitest::Mock.new; q.expect(:params, params); q}
  let(:resolver) { GraphQL::Query::OperationResolver.new(operation, query)}

  describe "variables" do
    it 'returns variables by name' do
      assert_equal(1, resolver.variables["cheeseId"])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graphql-0.3.0 spec/graph_ql/query/operation_resolver_spec.rb
graphql-0.2.0 spec/graph_ql/query/operation_resolver_spec.rb
graphql-0.1.0 spec/graph_ql/query/operation_resolver_spec.rb