Sha256: c51abf2ccfedfd5250d36c341171337c12cc48b68ab22a2464872fa16a2b056d
Contents?: true
Size: 837 Bytes
Versions: 26
Compression:
Stored size: 837 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe GraphQL::InputObjectType do describe 'default values' do describe 'when the type is an enum with underlying ruby values' do it 'provides the default value' do TestEnum = GraphQL::EnumType.define do name 'Test' value 'A', 'Represents an authorized agent in our system.', value: 'a' value 'B', 'Agent is disabled, web app access is denied.', value: 'b' end class TestInput < GraphQL::Schema::InputObject argument :foo, TestEnum, 'TestEnum', required: false, default_value: 'a' end test_input_type = TestInput.to_graphql default_test_input_value = test_input_type.coerce_isolated_input({}) assert_equal default_test_input_value[:foo], 'a' end end end end
Version data entries
26 entries across 26 versions & 1 rubygems