Sha256: 435661bcffb65b10aeecbfe94a5749b1d5243d16d1b5ccdd2a858c348a46e00a

Contents?: true

Size: 744 Bytes

Versions: 4

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

RSpec.shared_context "graphql query subject", type: :graphql_query do
  subject(:query_response) do |example|
    execute_query(
      try(:query) || example.metadata[:query],
      variables: try(:query_variables) || example.metadata[:query_variables],
      context: try(:query_context) || example.metadata[:query_context]
    )
  end
end

RSpec.shared_context "graphql mutation subject", type: :graphql_mutation do
  subject(:mutation_response) do |example|
    execute_mutation(
      try(:mutation) || example.metadata[:mutation],
      variables: try(:mutation_variables) || example.metadata[:mutation_variables],
      context: try(:mutation_context) || example.metadata[:mutation_context]
    )
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_graphql_api-0.3.1 spec/support/shared_contexts/graphql_query_subject.rb
solidus_graphql_api-0.3.0 spec/support/shared_contexts/graphql_query_subject.rb
solidus_graphql_api-0.2.0 spec/support/shared_contexts/graphql_query_subject.rb
solidus_graphql_api-0.1.0 spec/support/shared_contexts/graphql_query_subject.rb