Skip to content

Fix test with invalid default value #3451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/graphql/schema/input_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def self.resolve_type(type, obj, ctx)

it "works with empty objects" do
res = Jazz::Schema.execute("{ defaultValueTest2 }")
assert_equal "Jazz::InspectableInput -> {}", res["data"]["defaultValueTest2"]
assert_equal "Jazz::FullyOptionalInput -> {}", res["data"]["defaultValueTest2"]
end

it "introspects in GraphQL language with enums" do
Expand Down
6 changes: 5 additions & 1 deletion spec/support/jazz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ class LegacyInputType < GraphQL::Schema::InputObject
argument :int_value, Int, required: true
end

class FullyOptionalInput < GraphQL::Schema::InputObject
argument :optional_value, String, required: false
end

class InspectableInput < GraphQL::Schema::InputObject
argument :ensemble_id, ID, required: false, loads: Ensemble
argument :string_value, String, required: true, description: "Test description kwarg"
Expand Down Expand Up @@ -547,7 +551,7 @@ def default_value_test(arg_with_default:)
end

field :default_value_test_2, String, null: false, resolver_method: :default_value_test do
argument :arg_with_default, InspectableInput, required: false, default_value: {}
argument :arg_with_default, FullyOptionalInput, required: false, default_value: {}
end

field :complex_hash_key, String, null: false, hash_key: :'foo bar/fizz-buzz'
Expand Down