Sha256: 59827ff3ce00025fa1175e22ce922a73a217f2008682e1ea090c27d713051ae4
Contents?: true
Size: 776 Bytes
Versions: 2
Compression:
Stored size: 776 Bytes
Contents
require 'json' require 'graphql' require 'pry' require 'simplecov' require 'webmock/minitest' SimpleCov.start require 'graphql_client' require 'minitest/autorun' def fixture_path(name) File.join(__dir__, '/support/fixtures', name) end def schema_fixture(name) JSON.parse(File.read(fixture_path(name))) end def schema_type(type) @schema.type(type.unwrap.name) end class Minitest::Test def assert_valid_query(query_string, schema, operation_name: nil, variables: {}) query = GraphQL::Query.new( schema, query_string, max_depth: 10, max_complexity: 1000, operation_name: operation_name, variables: variables, ) assert query.valid?, "Query is not valid. Validation errors:\n" + query.validation_errors.to_s end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
graphql_client-0.4.1 | test/test_helper.rb |
graphql_client-0.3.3 | test/test_helper.rb |