diff --git a/.rubocop.yml b/.rubocop.yml index 19f0b0b294fbd1413d2b01bac590c37706932d08..2ed82e613650c4fee2cc13624f44a95481cc26fc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -446,9 +446,10 @@ Graphql/OldTypes: Include: - 'app/graphql/**/*' - 'ee/app/graphql/**/*' - Exclude: - - 'spec/**/*.rb' - - 'ee/spec/**/*.rb' + - 'spec/graphql/**/*' + - 'spec/requests/api/graphql/**/*' + - 'ee/spec/graphql/**/*' + - 'ee/spec/requests/api/graphql/**/*' RSpec/EnvAssignment: Enable: true diff --git a/.rubocop_manual_todo.yml b/.rubocop_manual_todo.yml index b2e0bebee3e051d1319c22a487d8b6929027b7ea..a2787f57bb04c889172cb9264eb02466d93561a4 100644 --- a/.rubocop_manual_todo.yml +++ b/.rubocop_manual_todo.yml @@ -23,23 +23,6 @@ Graphql/Descriptions: - 'ee/app/graphql/types/vulnerability_severity_enum.rb' - 'ee/app/graphql/types/vulnerability_state_enum.rb' -# WIP See https://gitlab.com/gitlab-org/gitlab/-/issues/336292 -Graphql/OldTypes: - Exclude: - - 'spec/**/*.rb' - - 'ee/spec/**/*.rb' - - 'ee/app/graphql/ee/mutations/ci/ci_cd_settings_update.rb' - - 'ee/app/graphql/ee/resolvers/issues_resolver.rb' - - 'ee/app/graphql/ee/resolvers/namespace_projects_resolver.rb' - - 'ee/app/graphql/ee/types/board_list_type.rb' - - 'ee/app/graphql/ee/types/boards/board_issue_input_base_type.rb' - - 'ee/app/graphql/ee/types/issue_connection_type.rb' - - 'ee/app/graphql/ee/types/issue_type.rb' - - 'ee/app/graphql/ee/types/issues/negated_issue_filter_input_type.rb' - - 'ee/app/graphql/ee/types/merge_request_type.rb' - - 'ee/app/graphql/ee/types/namespace_type.rb' - - 'ee/app/graphql/ee/types/project_type.rb' - # WIP: See https://gitlab.com/gitlab-org/gitlab/-/issues/220040 Rails/SaveBang: Exclude: diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index 62861fceb1a386b63591e2bed914e810ccf154fe..7a0f5ef9584f9776b8dbe67f8c01717aa3cee86c 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -82,7 +82,7 @@ class ProjectType < BaseObject snippets: 'Snippets are', container_registry: 'Container Registry is' }.each do |feature, name_string| - field "#{feature}_enabled", GraphQL::BOOLEAN_TYPE, null: true, + field "#{feature}_enabled", GraphQL::Types::Boolean, null: true, description: "Indicates if #{name_string} enabled for the current user" define_method "#{feature}_enabled" do diff --git a/spec/graphql/features/authorization_spec.rb b/spec/graphql/features/authorization_spec.rb index 0dc3a9c85e7dcbc0b9e0338bc48162980d6880ea..faf1910473188334627aae01d36ca77cc08e1f54 100644 --- a/spec/graphql/features/authorization_spec.rb +++ b/spec/graphql/features/authorization_spec.rb @@ -105,7 +105,7 @@ describe 'with a single permission' do let(:type) do type_factory do |type| - type.field :name, GraphQL::STRING_TYPE, null: true, authorize: permission_single + type.field :name, GraphQL::Types::String, null: true, authorize: permission_single end end @@ -124,7 +124,7 @@ let(:type) do permissions = permission_collection type_factory do |type| - type.field :name, GraphQL::STRING_TYPE, + type.field :name, GraphQL::Types::String, null: true, authorize: permissions end @@ -332,7 +332,7 @@ type_factory do |type| type.graphql_name 'FakeIssueType' type.authorize :read_issue - type.field :id, GraphQL::ID_TYPE, null: false + type.field :id, GraphQL::Types::ID, null: false end end diff --git a/spec/graphql/mutations/base_mutation_spec.rb b/spec/graphql/mutations/base_mutation_spec.rb index 5c51b74713b80a2868d9a05d15bbcefec71550c0..7939fadb37b96dda1094f8c03c401787239447c7 100644 --- a/spec/graphql/mutations/base_mutation_spec.rb +++ b/spec/graphql/mutations/base_mutation_spec.rb @@ -15,7 +15,7 @@ context 'when argument is nullable and required' do let(:mutation_class) do Class.new(described_class) do - argument :foo, GraphQL::STRING_TYPE, required: :nullable + argument :foo, GraphQL::Types::String, required: :nullable end end @@ -35,7 +35,7 @@ context 'when argument is required and NOT nullable' do let(:mutation_class) do Class.new(described_class) do - argument :foo, GraphQL::STRING_TYPE, required: true + argument :foo, GraphQL::Types::String, required: true end end diff --git a/spec/graphql/subscriptions/issuable_updated_spec.rb b/spec/graphql/subscriptions/issuable_updated_spec.rb index cc88b37627d99d6f6927a32db4c73765d4dcb277..c15b4f532efd3339e70c0aabf0cf70965a8b7b50 100644 --- a/spec/graphql/subscriptions/issuable_updated_spec.rb +++ b/spec/graphql/subscriptions/issuable_updated_spec.rb @@ -40,7 +40,7 @@ end end - context 'when a GraphQL::ID_TYPE is provided' do + context 'when a GraphQL::Types::ID is provided' do let(:issuable_id) { issue.to_gid.to_s } it 'raises an exception' do diff --git a/spec/lib/gitlab/graphql/calls_gitaly/field_extension_spec.rb b/spec/lib/gitlab/graphql/calls_gitaly/field_extension_spec.rb index 1d8849f7e38d5926d830fe973979035507d046c7..33f49dbc8d4c0e66653200169e3d658764515e97 100644 --- a/spec/lib/gitlab/graphql/calls_gitaly/field_extension_spec.rb +++ b/spec/lib/gitlab/graphql/calls_gitaly/field_extension_spec.rb @@ -7,7 +7,7 @@ let(:field_args) { {} } let(:owner) { fresh_object_type } let(:field) do - ::Types::BaseField.new(name: 'value', type: GraphQL::STRING_TYPE, null: true, owner: owner, **field_args) + ::Types::BaseField.new(name: 'value', type: GraphQL::Types::String, null: true, owner: owner, **field_args) end def resolve_value diff --git a/spec/lib/gitlab/graphql/copy_field_description_spec.rb b/spec/lib/gitlab/graphql/copy_field_description_spec.rb index 310b4046b56ced1d26fcf44002ceed3bf41bf06e..84aa548f2cf71f79ab9ceeccb4dc9745177ca7eb 100644 --- a/spec/lib/gitlab/graphql/copy_field_description_spec.rb +++ b/spec/lib/gitlab/graphql/copy_field_description_spec.rb @@ -10,7 +10,7 @@ Class.new(Types::BaseObject) do graphql_name "TestType" - field :field_name, GraphQL::STRING_TYPE, null: true, description: 'Foo' + field :field_name, GraphQL::Types::String, null: true, description: 'Foo' end end diff --git a/spec/lib/gitlab/graphql/mount_mutation_spec.rb b/spec/lib/gitlab/graphql/mount_mutation_spec.rb index d6b932e08d206f2c2d91cf441c882072e5d30c4a..fe25e923506043be30508d401e8cf80e41c514c9 100644 --- a/spec/lib/gitlab/graphql/mount_mutation_spec.rb +++ b/spec/lib/gitlab/graphql/mount_mutation_spec.rb @@ -6,8 +6,8 @@ Class.new(Mutations::BaseMutation) do graphql_name 'TestMutation' - argument :foo, GraphQL::STRING_TYPE, required: false - field :bar, GraphQL::STRING_TYPE, null: true + argument :foo, GraphQL::Types::String, required: false + field :bar, GraphQL::Types::String, null: true end end diff --git a/spec/lib/gitlab/graphql/negatable_arguments_spec.rb b/spec/lib/gitlab/graphql/negatable_arguments_spec.rb index bc6e25eb0183fc8150bc419d1b841b3c67a07969..71ef75836c0e0fc63a52a6a7f1f2250a2fe5ff36 100644 --- a/spec/lib/gitlab/graphql/negatable_arguments_spec.rb +++ b/spec/lib/gitlab/graphql/negatable_arguments_spec.rb @@ -19,7 +19,7 @@ it 'defines any arguments passed as block' do test_resolver.negated do - argument :foo, GraphQL::STRING_TYPE, required: false + argument :foo, GraphQL::Types::String, required: false end expect(test_resolver.arguments['not'].type.arguments.keys).to match_array(['foo']) @@ -27,10 +27,10 @@ it 'defines all arguments passed as block even if called multiple times' do test_resolver.negated do - argument :foo, GraphQL::STRING_TYPE, required: false + argument :foo, GraphQL::Types::String, required: false end test_resolver.negated do - argument :bar, GraphQL::STRING_TYPE, required: false + argument :bar, GraphQL::Types::String, required: false end expect(test_resolver.arguments['not'].type.arguments.keys).to match_array(%w[foo bar]) diff --git a/spec/lib/gitlab/graphql/pagination/connections_spec.rb b/spec/lib/gitlab/graphql/pagination/connections_spec.rb index e89e5c17644f0d6488090124d22b5f484accb8b1..f3f59113c819f28a47db944185d7e40c6cb947ec 100644 --- a/spec/lib/gitlab/graphql/pagination/connections_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/connections_spec.rb @@ -33,7 +33,7 @@ let(:node_type) do Class.new(::GraphQL::Schema::Object) do graphql_name 'Node' - field :value, GraphQL::INT_TYPE, null: false + field :value, GraphQL::Types::Int, null: false end end diff --git a/spec/lib/gitlab/graphql/present/field_extension_spec.rb b/spec/lib/gitlab/graphql/present/field_extension_spec.rb index 6ea313d30b3d4694fbb73e7983fa0143ac8f6e02..5f0f444e0bb655596d03d4e44695663509697c37 100644 --- a/spec/lib/gitlab/graphql/present/field_extension_spec.rb +++ b/spec/lib/gitlab/graphql/present/field_extension_spec.rb @@ -10,7 +10,7 @@ let(:owner) { fresh_object_type } let(:field_name) { 'value' } let(:field) do - ::Types::BaseField.new(name: field_name, type: GraphQL::STRING_TYPE, null: true, owner: owner) + ::Types::BaseField.new(name: field_name, type: GraphQL::Types::String, null: true, owner: owner) end let(:base_presenter) do @@ -38,7 +38,7 @@ def resolve_value Module.new do include ::Types::BaseInterface - field :interface_field, GraphQL::STRING_TYPE, null: true + field :interface_field, GraphQL::Types::String, null: true end end @@ -58,7 +58,7 @@ def interface_field end it 'resolves the interface field using the implementation from the presenter' do - field = ::Types::BaseField.new(name: :interface_field, type: GraphQL::STRING_TYPE, null: true, owner: interface) + field = ::Types::BaseField.new(name: :interface_field, type: GraphQL::Types::String, null: true, owner: interface) value = resolve_field(field, object, object_type: implementation) expect(value).to eq 'made of concrete' @@ -67,7 +67,7 @@ def interface_field context 'when the implementation is inherited' do it 'resolves the interface field using the implementation from the presenter' do subclass = Class.new(implementation) { graphql_name 'Subclass' } - field = ::Types::BaseField.new(name: :interface_field, type: GraphQL::STRING_TYPE, null: true, owner: interface) + field = ::Types::BaseField.new(name: :interface_field, type: GraphQL::Types::String, null: true, owner: interface) value = resolve_field(field, object, object_type: subclass) expect(value).to eq 'made of concrete' @@ -79,8 +79,8 @@ def interface_field def parent type = fresh_object_type('Parent') type.present_using(provide_foo) - type.field :foo, ::GraphQL::INT_TYPE, null: true - type.field :value, ::GraphQL::STRING_TYPE, null: true + type.field :foo, ::GraphQL::Types::Int, null: true + type.field :value, ::GraphQL::Types::String, null: true type end @@ -88,7 +88,7 @@ def child type = Class.new(parent) type.graphql_name 'Child' type.present_using(provide_bar) - type.field :bar, ::GraphQL::INT_TYPE, null: true + type.field :bar, ::GraphQL::Types::Int, null: true type end @@ -150,7 +150,7 @@ def value let(:field) do ::Types::BaseField.new( name: field_name, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: true, owner: owner, resolve: ->(obj, args, ctx) { 'Hello from a proc' } diff --git a/spec/lib/gitlab/graphql/queries_spec.rb b/spec/lib/gitlab/graphql/queries_spec.rb index a1cd2cdb2def933135198727a40fb317ca544c65..8b7f4ca793335ff2c3504a041fbb160021da98fd 100644 --- a/spec/lib/gitlab/graphql/queries_spec.rb +++ b/spec/lib/gitlab/graphql/queries_spec.rb @@ -21,30 +21,30 @@ let_it_be(:schema) do author = Class.new(GraphQL::Schema::Object) do graphql_name 'Author' - field :name, GraphQL::STRING_TYPE, null: true - field :handle, GraphQL::STRING_TYPE, null: false - field :verified, GraphQL::BOOLEAN_TYPE, null: false + field :name, GraphQL::Types::String, null: true + field :handle, GraphQL::Types::String, null: false + field :verified, GraphQL::Types::Boolean, null: false end post = Class.new(GraphQL::Schema::Object) do graphql_name 'Post' - field :name, GraphQL::STRING_TYPE, null: false - field :title, GraphQL::STRING_TYPE, null: false - field :content, GraphQL::STRING_TYPE, null: true + field :name, GraphQL::Types::String, null: false + field :title, GraphQL::Types::String, null: false + field :content, GraphQL::Types::String, null: true field :author, author, null: false end author.field :posts, [post], null: false do - argument :blog_title, GraphQL::STRING_TYPE, required: false + argument :blog_title, GraphQL::Types::String, required: false end blog = Class.new(GraphQL::Schema::Object) do graphql_name 'Blog' - field :title, GraphQL::STRING_TYPE, null: false - field :description, GraphQL::STRING_TYPE, null: false + field :title, GraphQL::Types::String, null: false + field :description, GraphQL::Types::String, null: false field :main_author, author, null: false field :posts, [post], null: false field :post, post, null: true do - argument :slug, GraphQL::STRING_TYPE, required: true + argument :slug, GraphQL::Types::String, required: true end end @@ -52,10 +52,10 @@ query(Class.new(GraphQL::Schema::Object) do graphql_name 'Query' field :blog, blog, null: true do - argument :title, GraphQL::STRING_TYPE, required: true + argument :title, GraphQL::Types::String, required: true end field :post, post, null: true do - argument :slug, GraphQL::STRING_TYPE, required: true + argument :slug, GraphQL::Types::String, required: true end end) end diff --git a/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb b/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb index 30028a1f1aa7259e5264f29185d6c7d6c061aa7b..35b21477d80e98a4495e34f2877bfa5be4b931e1 100644 --- a/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb +++ b/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb @@ -222,7 +222,7 @@ class Foo < ApplicationRecord include_examples 'does not set any flags as used', 'field :solution' include_examples 'does not set any flags as used', 'field :runners, Types::Ci::RunnerType.connection_type' include_examples 'does not set any flags as used', 'field :runners, Types::Ci::RunnerType.connection_type, null: true, description: "hello world"' - include_examples 'does not set any flags as used', 'field :solution, type: GraphQL::STRING_TYPE, null: true, description: "URL to the vulnerabilitys details page."' + include_examples 'does not set any flags as used', 'field :solution, type: GraphQL::Types::String, null: true, description: "URL to the vulnerabilitys details page."' end describe "tracking of usage data metrics known events happens at the beginning of inspection" do diff --git a/spec/rubocop/cop/graphql/descriptions_spec.rb b/spec/rubocop/cop/graphql/descriptions_spec.rb index 9709a253bdc43cff9d2b8d5e46a69470ffaa3139..f11b5346843c9067f88800c70ab8659b9a2a5b27 100644 --- a/spec/rubocop/cop/graphql/descriptions_spec.rb +++ b/spec/rubocop/cop/graphql/descriptions_spec.rb @@ -13,7 +13,7 @@ module Types class FakeType < BaseObject field :a_thing, ^^^^^^^^^^^^^^^ Please add a `description` property. - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false end end @@ -26,7 +26,7 @@ module Types class FakeType < BaseObject field :a_thing, ^^^^^^^^^^^^^^^ `description` strings must end with a `.`. - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: 'A descriptive description' end @@ -39,7 +39,7 @@ class FakeType < BaseObject module Types class FakeType < BaseObject field :a_thing, - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: 'A descriptive description.' end @@ -65,7 +65,7 @@ module Types class FakeType < BaseObject argument :a_thing, ^^^^^^^^^^^^^^^^^^ Please add a `description` property. - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false end end @@ -78,7 +78,7 @@ module Types class FakeType < BaseObject argument :a_thing, ^^^^^^^^^^^^^^^^^^ `description` strings must end with a `.`. - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: 'Behold! A description' end @@ -91,7 +91,7 @@ class FakeType < BaseObject module Types class FakeType < BaseObject argument :a_thing, - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: 'Behold! A description.' end @@ -151,7 +151,7 @@ module Types class FakeType < BaseObject field :a_thing, ^^^^^^^^^^^^^^^ `description` strings must end with a `.`. - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: 'Behold! A description' end @@ -162,7 +162,7 @@ class FakeType < BaseObject module Types class FakeType < BaseObject field :a_thing, - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: 'Behold! A description.' end @@ -176,7 +176,7 @@ module Types class FakeType < BaseObject field :a_thing, ^^^^^^^^^^^^^^^ `description` strings must end with a `.`. - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: <<~DESC Behold! A description @@ -189,7 +189,7 @@ class FakeType < BaseObject module Types class FakeType < BaseObject field :a_thing, - GraphQL::STRING_TYPE, + GraphQL::Types::String, null: false, description: <<~DESC Behold! A description. diff --git a/spec/rubocop/cop/graphql/id_type_spec.rb b/spec/rubocop/cop/graphql/id_type_spec.rb index 771e4e32dd296828bd8064194550699e0a8fe8c7..d71031c6e1a35d59a12d7c59394f7e4579268744 100644 --- a/spec/rubocop/cop/graphql/id_type_spec.rb +++ b/spec/rubocop/cop/graphql/id_type_spec.rb @@ -24,7 +24,7 @@ end end - it 'does not add an offense for calls to #argument without GraphQL::ID_TYPE' do + it 'does not add an offense for calls to #argument without GraphQL::Types::ID' do expect_no_offenses(<<~TYPE.strip) argument :some_arg, ::Types::GlobalIDType[::Awardable], some: other, params: do_not_matter TYPE diff --git a/spec/rubocop/cop/graphql/json_type_spec.rb b/spec/rubocop/cop/graphql/json_type_spec.rb index 50437953c1de8fca6270a598e8305aa7952d892f..882e2b2ef88ea2d1e368f3bf9c916f5f3b771db1 100644 --- a/spec/rubocop/cop/graphql/json_type_spec.rb +++ b/spec/rubocop/cop/graphql/json_type_spec.rb @@ -32,7 +32,7 @@ class MyType it 'does not add an offense for other types' do expect_no_offenses(<<~RUBY.strip) class MyType - field :some_field, GraphQL::STRING_TYPE + field :some_field, GraphQL::Types::String end RUBY end @@ -60,7 +60,7 @@ class MyType it 'does not add an offense for other types' do expect_no_offenses(<<~RUBY.strip) class MyType - argument :some_arg, GraphQL::STRING_TYPE + argument :some_arg, GraphQL::Types::String end RUBY end diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb index 38cf828ca5e28afa9cd901b873a897b391eea31c..6f17d3cb49683c51f38c7d6ee91b5082e03cc149 100644 --- a/spec/support/helpers/graphql_helpers.rb +++ b/spec/support/helpers/graphql_helpers.rb @@ -654,7 +654,7 @@ def type_factory Class.new(Types::BaseObject) do graphql_name 'TestType' - field :name, GraphQL::STRING_TYPE, null: true + field :name, GraphQL::Types::String, null: true yield(self) if block_given? end diff --git a/spec/tooling/graphql/docs/renderer_spec.rb b/spec/tooling/graphql/docs/renderer_spec.rb index 50ebb754ca469b6240ca9e029dbeed2e7e25180c..de5ec928921b741c2bf18cf5fbf15fe8dee7641c 100644 --- a/spec/tooling/graphql/docs/renderer_spec.rb +++ b/spec/tooling/graphql/docs/renderer_spec.rb @@ -14,13 +14,13 @@ let(:template) { Rails.root.join('tooling/graphql/docs/templates/default.md.haml') } let(:field_description) { 'List of objects.' } - let(:type) { ::GraphQL::INT_TYPE } + let(:type) { ::GraphQL::Types::Int } let(:query_type) do Class.new(Types::BaseObject) { graphql_name 'Query' }.tap do |t| # this keeps type and field_description in scope. t.field :foo, type, null: true, description: field_description do - argument :id, GraphQL::ID_TYPE, required: false, description: 'ID of the object.' + argument :id, GraphQL::Types::ID, required: false, description: 'ID of the object.' end end end @@ -73,7 +73,7 @@ def resolve_type(obj, ctx) Class.new(Types::BaseObject) do graphql_name 'ArrayTest' - field :foo, [GraphQL::STRING_TYPE], null: false, description: 'A description.' + field :foo, [GraphQL::Types::String], null: false, description: 'A description.' end end @@ -129,8 +129,8 @@ def resolve_type(obj, ctx) Class.new(Types::BaseObject) do graphql_name 'OrderingTest' - field :foo, GraphQL::STRING_TYPE, null: false, description: 'A description of foo field.' - field :bar, GraphQL::STRING_TYPE, null: false, description: 'A description of bar field.' + field :foo, GraphQL::Types::String, null: false, description: 'A description of foo field.' + field :bar, GraphQL::Types::String, null: false, description: 'A description of bar field.' end end @@ -154,7 +154,7 @@ def resolve_type(obj, ctx) let(:type) do wibble = Class.new(::Types::BaseObject) do graphql_name 'Wibble' - field :x, ::GraphQL::INT_TYPE, null: false + field :x, ::GraphQL::Types::Int, null: false end Class.new(Types::BaseObject) do @@ -162,16 +162,16 @@ def resolve_type(obj, ctx) description 'Testing doc refs' field :foo, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'The foo.', see: { 'A list of foos' => 'https://example.com/foos' } field :bar, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'The bar.', see: { 'A list of bars' => 'https://example.com/bars' } do - argument :barity, ::GraphQL::INT_TYPE, required: false, description: '?' + argument :barity, ::GraphQL::Types::Int, required: false, description: '?' end field :wibbles, type: wibble.connection_type, @@ -220,10 +220,10 @@ def resolve_type(obj, ctx) description 'A thing we used to use, but no longer support' field :foo, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'A description.' do - argument :foo_arg, GraphQL::STRING_TYPE, + argument :foo_arg, GraphQL::Types::String, required: false, description: 'The argument.', deprecated: { reason: 'Bad argument', milestone: '101.2' } @@ -257,19 +257,19 @@ def resolve_type(obj, ctx) description 'A thing we used to use, but no longer support' field :foo, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, deprecated: { reason: 'This is deprecated', milestone: '1.10' }, description: 'A description.' field :foo_with_args, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, deprecated: { reason: 'Do not use', milestone: '1.10', replacement: 'X.y' }, description: 'A description.' do - argument :arg, GraphQL::INT_TYPE, required: false, description: 'Argity' + argument :arg, GraphQL::Types::Int, required: false, description: 'Argity' end field :bar, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'A description.', deprecated: { @@ -328,7 +328,7 @@ def resolve_type(obj, ctx) ) end - let(:type) { ::GraphQL::INT_TYPE } + let(:type) { ::GraphQL::Types::Int } let(:section) do <<~DOC ### `Query.bar` @@ -453,12 +453,12 @@ def resolve_type(obj, ctx) } mutation.field :everything, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: true, description: 'What we made prettier.' mutation.field :omnis, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: true, description: 'What we made prettier.', deprecated: { @@ -516,7 +516,7 @@ def resolve_type(obj, ctx) let(:type) do Class.new(::Types::BaseObject) do graphql_name 'Foo' - field :wibble, type: ::GraphQL::INT_TYPE, null: true do + field :wibble, type: ::GraphQL::Types::Int, null: true do argument :date_range, type: ::Types::TimeframeInputType, required: true, @@ -547,10 +547,10 @@ def resolve_type(obj, ctx) let(:type) do user = Class.new(::Types::BaseObject) user.graphql_name 'User' - user.field :user_field, ::GraphQL::STRING_TYPE, null: true + user.field :user_field, ::GraphQL::Types::String, null: true group = Class.new(::Types::BaseObject) group.graphql_name 'Group' - group.field :group_field, ::GraphQL::STRING_TYPE, null: true + group.field :group_field, ::GraphQL::Types::String, null: true union = Class.new(::Types::BaseUnion) union.graphql_name 'UserOrGroup' @@ -561,7 +561,7 @@ def resolve_type(obj, ctx) interface.include(::Types::BaseInterface) interface.graphql_name 'Flying' interface.description 'Something that can fly.' - interface.field :flight_speed, GraphQL::INT_TYPE, null: true, description: 'Speed in mph.' + interface.field :flight_speed, GraphQL::Types::Int, null: true, description: 'Speed in mph.' african_swallow = Class.new(::Types::BaseObject) african_swallow.graphql_name 'AfricanSwallow'