Commit 02ede8d8 authored by Brett Walker's avatar Brett Walker

Convert old graphql types to newer types

in prep for interpreter
parent c306cca2
...@@ -104,28 +104,6 @@ Graphql/OldTypes: ...@@ -104,28 +104,6 @@ Graphql/OldTypes:
- 'app/graphql/types/container_repository_type.rb' - 'app/graphql/types/container_repository_type.rb'
- 'app/graphql/types/countable_connection_type.rb' - 'app/graphql/types/countable_connection_type.rb'
- 'app/graphql/types/custom_emoji_type.rb' - 'app/graphql/types/custom_emoji_type.rb'
- 'app/graphql/types/query_complexity_type.rb'
- 'app/graphql/types/release_asset_link_shared_input_arguments.rb'
- 'app/graphql/types/release_asset_link_type.rb'
- 'app/graphql/types/release_assets_type.rb'
- 'app/graphql/types/release_links_type.rb'
- 'app/graphql/types/release_source_type.rb'
- 'app/graphql/types/release_type.rb'
- 'app/graphql/types/repository/blob_type.rb'
- 'app/graphql/types/repository_type.rb'
- 'app/graphql/types/resolvable_interface.rb'
- 'app/graphql/types/snippet_type.rb'
- 'app/graphql/types/snippets/blob_action_input_type.rb'
- 'app/graphql/types/snippets/blob_type.rb'
- 'app/graphql/types/task_completion_status.rb'
- 'app/graphql/types/terraform/state_type.rb'
- 'app/graphql/types/terraform/state_version_type.rb'
- 'app/graphql/types/timelog_type.rb'
- 'app/graphql/types/todo_type.rb'
- 'app/graphql/types/tree/blob_type.rb'
- 'app/graphql/types/tree/entry_type.rb'
- 'app/graphql/types/tree/tree_entry_type.rb'
- 'app/graphql/types/user_status_type.rb'
- 'ee/app/graphql/ee/mutations/ci/ci_cd_settings_update.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/issues_resolver.rb'
- 'ee/app/graphql/ee/resolvers/namespace_projects_resolver.rb' - 'ee/app/graphql/ee/resolvers/namespace_projects_resolver.rb'
......
...@@ -9,7 +9,7 @@ module Types ...@@ -9,7 +9,7 @@ module Types
alias_method :query, :object alias_method :query, :object
field :limit, GraphQL::INT_TYPE, field :limit, GraphQL::Types::Int,
null: true, null: true,
method: :max_complexity, method: :max_complexity,
see: { see: {
...@@ -18,7 +18,7 @@ module Types ...@@ -18,7 +18,7 @@ module Types
}, },
description: 'GraphQL query complexity limit.' description: 'GraphQL query complexity limit.'
field :score, GraphQL::INT_TYPE, field :score, GraphQL::Types::Int,
null: true, null: true,
description: 'GraphQL query complexity score.' description: 'GraphQL query complexity score.'
......
...@@ -5,15 +5,15 @@ module Types ...@@ -5,15 +5,15 @@ module Types
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::Types::String,
required: true, required: true,
description: 'Name of the asset link.' description: 'Name of the asset link.'
argument :url, GraphQL::STRING_TYPE, argument :url, GraphQL::Types::String,
required: true, required: true,
description: 'URL of the asset link.' description: 'URL of the asset link.'
argument :direct_asset_path, GraphQL::STRING_TYPE, argument :direct_asset_path, GraphQL::Types::String,
required: false, as: :filepath, required: false, as: :filepath,
description: 'Relative path for a direct asset link.' description: 'Relative path for a direct asset link.'
......
...@@ -7,20 +7,20 @@ module Types ...@@ -7,20 +7,20 @@ module Types
authorize :read_release authorize :read_release
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the link.' description: 'ID of the link.'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the link.' description: 'Name of the link.'
field :url, GraphQL::STRING_TYPE, null: true, field :url, GraphQL::Types::String, null: true,
description: 'URL of the link.' description: 'URL of the link.'
field :link_type, Types::ReleaseAssetLinkTypeEnum, null: true, field :link_type, Types::ReleaseAssetLinkTypeEnum, null: true,
description: 'Type of the link: `other`, `runbook`, `image`, `package`; defaults to `other`.' description: 'Type of the link: `other`, `runbook`, `image`, `package`; defaults to `other`.'
field :external, GraphQL::BOOLEAN_TYPE, null: true, method: :external?, field :external, GraphQL::Types::Boolean, null: true, method: :external?,
description: 'Indicates the link points to an external resource.' description: 'Indicates the link points to an external resource.'
field :direct_asset_url, GraphQL::STRING_TYPE, null: true, field :direct_asset_url, GraphQL::Types::String, null: true,
description: 'Direct asset URL of the link.' description: 'Direct asset URL of the link.'
field :direct_asset_path, GraphQL::STRING_TYPE, null: true, method: :filepath, field :direct_asset_path, GraphQL::Types::String, null: true, method: :filepath,
description: 'Relative path for the direct asset link.' description: 'Relative path for the direct asset link.'
def direct_asset_url def direct_asset_url
......
...@@ -11,7 +11,7 @@ module Types ...@@ -11,7 +11,7 @@ module Types
present_using ReleasePresenter present_using ReleasePresenter
field :count, GraphQL::INT_TYPE, null: true, method: :assets_count, field :count, GraphQL::Types::Int, null: true, method: :assets_count,
description: 'Number of assets of the release.' description: 'Number of assets of the release.'
field :links, Types::ReleaseAssetLinkType.connection_type, null: true, method: :sorted_links, field :links, Types::ReleaseAssetLinkType.connection_type, null: true, method: :sorted_links,
description: 'Asset links of the release.' description: 'Asset links of the release.'
......
...@@ -10,20 +10,20 @@ module Types ...@@ -10,20 +10,20 @@ module Types
present_using ReleasePresenter present_using ReleasePresenter
field :self_url, GraphQL::STRING_TYPE, null: true, field :self_url, GraphQL::Types::String, null: true,
description: 'HTTP URL of the release.' description: 'HTTP URL of the release.'
field :edit_url, GraphQL::STRING_TYPE, null: true, field :edit_url, GraphQL::Types::String, null: true,
description: "HTTP URL of the release's edit page.", description: "HTTP URL of the release's edit page.",
authorize: :update_release authorize: :update_release
field :opened_merge_requests_url, GraphQL::STRING_TYPE, null: true, field :opened_merge_requests_url, GraphQL::Types::String, null: true,
description: 'HTTP URL of the merge request page, filtered by this release and `state=open`.' description: 'HTTP URL of the merge request page, filtered by this release and `state=open`.'
field :merged_merge_requests_url, GraphQL::STRING_TYPE, null: true, field :merged_merge_requests_url, GraphQL::Types::String, null: true,
description: 'HTTP URL of the merge request page , filtered by this release and `state=merged`.' description: 'HTTP URL of the merge request page , filtered by this release and `state=merged`.'
field :closed_merge_requests_url, GraphQL::STRING_TYPE, null: true, field :closed_merge_requests_url, GraphQL::Types::String, null: true,
description: 'HTTP URL of the merge request page , filtered by this release and `state=closed`.' description: 'HTTP URL of the merge request page , filtered by this release and `state=closed`.'
field :opened_issues_url, GraphQL::STRING_TYPE, null: true, field :opened_issues_url, GraphQL::Types::String, null: true,
description: 'HTTP URL of the issues page, filtered by this release and `state=open`.' description: 'HTTP URL of the issues page, filtered by this release and `state=open`.'
field :closed_issues_url, GraphQL::STRING_TYPE, null: true, field :closed_issues_url, GraphQL::Types::String, null: true,
description: 'HTTP URL of the issues page, filtered by this release and `state=closed`.' description: 'HTTP URL of the issues page, filtered by this release and `state=closed`.'
end end
end end
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
authorize :download_code authorize :download_code
field :format, GraphQL::STRING_TYPE, null: true, field :format, GraphQL::Types::String, null: true,
description: 'Format of the source.' description: 'Format of the source.'
field :url, GraphQL::STRING_TYPE, null: true, field :url, GraphQL::Types::String, null: true,
description: 'Download URL of the source.' description: 'Download URL of the source.'
end end
end end
...@@ -13,22 +13,22 @@ module Types ...@@ -13,22 +13,22 @@ module Types
present_using ReleasePresenter present_using ReleasePresenter
field :tag_name, GraphQL::STRING_TYPE, null: true, method: :tag, field :tag_name, GraphQL::Types::String, null: true, method: :tag,
description: 'Name of the tag associated with the release.', description: 'Name of the tag associated with the release.',
authorize: :download_code authorize: :download_code
field :tag_path, GraphQL::STRING_TYPE, null: true, field :tag_path, GraphQL::Types::String, null: true,
description: 'Relative web path to the tag associated with the release.', description: 'Relative web path to the tag associated with the release.',
authorize: :download_code authorize: :download_code
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::Types::String, null: true,
description: 'Description (also known as "release notes") of the release.' description: 'Description (also known as "release notes") of the release.'
markdown_field :description_html, null: true markdown_field :description_html, null: true
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the release.' description: 'Name of the release.'
field :created_at, Types::TimeType, null: true, field :created_at, Types::TimeType, null: true,
description: 'Timestamp of when the release was created.' description: 'Timestamp of when the release was created.'
field :released_at, Types::TimeType, null: true, field :released_at, Types::TimeType, null: true,
description: 'Timestamp of when the release was released.' description: 'Timestamp of when the release was released.'
field :upcoming_release, GraphQL::BOOLEAN_TYPE, null: true, method: :upcoming_release?, field :upcoming_release, GraphQL::Types::Boolean, null: true, method: :upcoming_release?,
description: 'Indicates the release is an upcoming release.' description: 'Indicates the release is an upcoming release.'
field :assets, Types::ReleaseAssetsType, null: true, method: :itself, field :assets, Types::ReleaseAssetsType, null: true, method: :itself,
description: 'Assets of the release.' description: 'Assets of the release.'
......
...@@ -8,67 +8,67 @@ module Types ...@@ -8,67 +8,67 @@ module Types
graphql_name 'RepositoryBlob' graphql_name 'RepositoryBlob'
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the blob.' description: 'ID of the blob.'
field :oid, GraphQL::STRING_TYPE, null: false, method: :id, field :oid, GraphQL::Types::String, null: false, method: :id,
description: 'OID of the blob.' description: 'OID of the blob.'
field :path, GraphQL::STRING_TYPE, null: false, field :path, GraphQL::Types::String, null: false,
description: 'Path of the blob.' description: 'Path of the blob.'
field :name, GraphQL::STRING_TYPE, field :name, GraphQL::Types::String,
description: 'Blob name.', description: 'Blob name.',
null: true null: true
field :mode, type: GraphQL::STRING_TYPE, field :mode, type: GraphQL::Types::String,
description: 'Blob mode.', description: 'Blob mode.',
null: true null: true
field :lfs_oid, GraphQL::STRING_TYPE, null: true, field :lfs_oid, GraphQL::Types::String, null: true,
calls_gitaly: true, calls_gitaly: true,
description: 'LFS OID of the blob.' description: 'LFS OID of the blob.'
field :web_path, GraphQL::STRING_TYPE, null: true, field :web_path, GraphQL::Types::String, null: true,
description: 'Web path of the blob.' description: 'Web path of the blob.'
field :ide_edit_path, GraphQL::STRING_TYPE, null: true, field :ide_edit_path, GraphQL::Types::String, null: true,
description: 'Web path to edit this blob in the Web IDE.' description: 'Web path to edit this blob in the Web IDE.'
field :fork_and_edit_path, GraphQL::STRING_TYPE, null: true, field :fork_and_edit_path, GraphQL::Types::String, null: true,
description: 'Web path to edit this blob using a forked project.' description: 'Web path to edit this blob using a forked project.'
field :ide_fork_and_edit_path, GraphQL::STRING_TYPE, null: true, field :ide_fork_and_edit_path, GraphQL::Types::String, null: true,
description: 'Web path to edit this blob in the Web IDE using a forked project.' description: 'Web path to edit this blob in the Web IDE using a forked project.'
field :size, GraphQL::INT_TYPE, null: true, field :size, GraphQL::Types::Int, null: true,
description: 'Size (in bytes) of the blob.' description: 'Size (in bytes) of the blob.'
field :raw_size, GraphQL::INT_TYPE, null: true, field :raw_size, GraphQL::Types::Int, null: true,
description: 'Size (in bytes) of the blob, or the blob target if stored externally.' description: 'Size (in bytes) of the blob, or the blob target if stored externally.'
field :raw_blob, GraphQL::STRING_TYPE, null: true, method: :data, field :raw_blob, GraphQL::Types::String, null: true, method: :data,
description: 'The raw content of the blob.' description: 'The raw content of the blob.'
field :raw_text_blob, GraphQL::STRING_TYPE, null: true, method: :text_only_data, field :raw_text_blob, GraphQL::Types::String, null: true, method: :text_only_data,
description: 'The raw content of the blob, if the blob is text data.' description: 'The raw content of the blob, if the blob is text data.'
field :stored_externally, GraphQL::BOOLEAN_TYPE, null: true, method: :stored_externally?, field :stored_externally, GraphQL::Types::Boolean, null: true, method: :stored_externally?,
description: "Whether the blob's content is stored externally (for instance, in LFS)." description: "Whether the blob's content is stored externally (for instance, in LFS)."
field :edit_blob_path, GraphQL::STRING_TYPE, null: true, field :edit_blob_path, GraphQL::Types::String, null: true,
description: 'Web path to edit the blob in the old-style editor.' description: 'Web path to edit the blob in the old-style editor.'
field :raw_path, GraphQL::STRING_TYPE, null: true, field :raw_path, GraphQL::Types::String, null: true,
description: 'Web path to download the raw blob.' description: 'Web path to download the raw blob.'
field :external_storage_url, GraphQL::STRING_TYPE, null: true, field :external_storage_url, GraphQL::Types::String, null: true,
description: 'Web path to download the raw blob via external storage, if enabled.' description: 'Web path to download the raw blob via external storage, if enabled.'
field :replace_path, GraphQL::STRING_TYPE, null: true, field :replace_path, GraphQL::Types::String, null: true,
description: 'Web path to replace the blob content.' description: 'Web path to replace the blob content.'
field :file_type, GraphQL::STRING_TYPE, null: true, field :file_type, GraphQL::Types::String, null: true,
description: 'The expected format of the blob based on the extension.' description: 'The expected format of the blob based on the extension.'
field :simple_viewer, type: Types::BlobViewerType, field :simple_viewer, type: Types::BlobViewerType,
...@@ -79,12 +79,12 @@ module Types ...@@ -79,12 +79,12 @@ module Types
description: 'Blob content rich viewer.', description: 'Blob content rich viewer.',
null: true null: true
field :plain_data, GraphQL::STRING_TYPE, field :plain_data, GraphQL::Types::String,
description: 'Blob plain highlighted data.', description: 'Blob plain highlighted data.',
null: true, null: true,
calls_gitaly: true calls_gitaly: true
field :can_modify_blob, GraphQL::BOOLEAN_TYPE, null: true, method: :can_modify_blob?, field :can_modify_blob, GraphQL::Types::Boolean, null: true, method: :can_modify_blob?,
calls_gitaly: true, calls_gitaly: true,
description: 'Whether the current user can modify the blob.' description: 'Whether the current user can modify the blob.'
......
...@@ -6,20 +6,20 @@ module Types ...@@ -6,20 +6,20 @@ module Types
authorize :download_code authorize :download_code
field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true, field :root_ref, GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Default branch of the repository.' description: 'Default branch of the repository.'
field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true, field :empty, GraphQL::Types::Boolean, null: false, method: :empty?, calls_gitaly: true,
description: 'Indicates repository has no visible content.' description: 'Indicates repository has no visible content.'
field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists?, calls_gitaly: true, field :exists, GraphQL::Types::Boolean, null: false, method: :exists?, calls_gitaly: true,
description: 'Indicates a corresponding Git repository exists on disk.' description: 'Indicates a corresponding Git repository exists on disk.'
field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true, field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true,
description: 'Tree of the repository.' description: 'Tree of the repository.'
field :blobs, Types::Repository::BlobType.connection_type, null: true, resolver: Resolvers::BlobsResolver, calls_gitaly: true, field :blobs, Types::Repository::BlobType.connection_type, null: true, resolver: Resolvers::BlobsResolver, calls_gitaly: true,
description: 'Blobs contained within the repository' description: 'Blobs contained within the repository'
field :branch_names, [GraphQL::STRING_TYPE], null: true, calls_gitaly: true, field :branch_names, [GraphQL::Types::String], null: true, calls_gitaly: true,
complexity: 170, description: 'Names of branches available in this repository that match the search pattern.', complexity: 170, description: 'Names of branches available in this repository that match the search pattern.',
resolver: Resolvers::RepositoryBranchNamesResolver resolver: Resolvers::RepositoryBranchNamesResolver
field :disk_path, GraphQL::STRING_TYPE, field :disk_path, GraphQL::Types::String,
description: 'Shows a disk path of the repository.', description: 'Shows a disk path of the repository.',
null: true, null: true,
authorize: :read_storage_disk_path authorize: :read_storage_disk_path
......
...@@ -16,10 +16,10 @@ module Types ...@@ -16,10 +16,10 @@ module Types
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.resolved_by_id).find Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.resolved_by_id).find
end end
field :resolved, GraphQL::BOOLEAN_TYPE, null: false, field :resolved, GraphQL::Types::Boolean, null: false,
description: 'Indicates if the object is resolved.', description: 'Indicates if the object is resolved.',
method: :resolved? method: :resolved?
field :resolvable, GraphQL::BOOLEAN_TYPE, null: false, field :resolvable, GraphQL::Types::Boolean, null: false,
description: 'Indicates if the object can be resolved.', description: 'Indicates if the object can be resolved.',
method: :resolvable? method: :resolvable?
field :resolved_at, Types::TimeType, null: true, field :resolved_at, Types::TimeType, null: true,
......
...@@ -17,7 +17,7 @@ module Types ...@@ -17,7 +17,7 @@ module Types
description: 'ID of the snippet.', description: 'ID of the snippet.',
null: false null: false
field :title, GraphQL::STRING_TYPE, field :title, GraphQL::Types::String,
description: 'Title of the snippet.', description: 'Title of the snippet.',
null: false null: false
...@@ -33,11 +33,11 @@ module Types ...@@ -33,11 +33,11 @@ module Types
description: 'The owner of the snippet.', description: 'The owner of the snippet.',
null: true null: true
field :file_name, GraphQL::STRING_TYPE, field :file_name, GraphQL::Types::String,
description: 'File Name of the snippet.', description: 'File Name of the snippet.',
null: true null: true
field :description, GraphQL::STRING_TYPE, field :description, GraphQL::Types::String,
description: 'Description of the snippet.', description: 'Description of the snippet.',
null: true null: true
...@@ -53,11 +53,11 @@ module Types ...@@ -53,11 +53,11 @@ module Types
description: 'Timestamp this snippet was updated.', description: 'Timestamp this snippet was updated.',
null: false null: false
field :web_url, type: GraphQL::STRING_TYPE, field :web_url, type: GraphQL::Types::String,
description: 'Web URL of the snippet.', description: 'Web URL of the snippet.',
null: false null: false
field :raw_url, type: GraphQL::STRING_TYPE, field :raw_url, type: GraphQL::Types::String,
description: 'Raw URL of the snippet.', description: 'Raw URL of the snippet.',
null: false null: false
...@@ -67,12 +67,12 @@ module Types ...@@ -67,12 +67,12 @@ module Types
null: true, null: true,
resolver: Resolvers::Snippets::BlobsResolver resolver: Resolvers::Snippets::BlobsResolver
field :ssh_url_to_repo, type: GraphQL::STRING_TYPE, field :ssh_url_to_repo, type: GraphQL::Types::String,
description: 'SSH URL to the snippet repository.', description: 'SSH URL to the snippet repository.',
calls_gitaly: true, calls_gitaly: true,
null: true null: true
field :http_url_to_repo, type: GraphQL::STRING_TYPE, field :http_url_to_repo, type: GraphQL::Types::String,
description: 'HTTP URL to the snippet repository.', description: 'HTTP URL to the snippet repository.',
calls_gitaly: true, calls_gitaly: true,
null: true null: true
......
...@@ -10,15 +10,15 @@ module Types ...@@ -10,15 +10,15 @@ module Types
description: 'Type of input action.', description: 'Type of input action.',
required: true required: true
argument :previous_path, GraphQL::STRING_TYPE, argument :previous_path, GraphQL::Types::String,
description: 'Previous path of the snippet file.', description: 'Previous path of the snippet file.',
required: false required: false
argument :file_path, GraphQL::STRING_TYPE, argument :file_path, GraphQL::Types::String,
description: 'Path of the snippet file.', description: 'Path of the snippet file.',
required: true required: true
argument :content, GraphQL::STRING_TYPE, argument :content, GraphQL::Types::String,
description: 'Snippet file content.', description: 'Snippet file content.',
required: false required: false
end end
......
...@@ -8,36 +8,36 @@ module Types ...@@ -8,36 +8,36 @@ module Types
description 'Represents the snippet blob' description 'Represents the snippet blob'
present_using SnippetBlobPresenter present_using SnippetBlobPresenter
field :rich_data, GraphQL::STRING_TYPE, field :rich_data, GraphQL::Types::String,
description: 'Blob highlighted data.', description: 'Blob highlighted data.',
null: true null: true
field :plain_data, GraphQL::STRING_TYPE, field :plain_data, GraphQL::Types::String,
description: 'Blob plain highlighted data.', description: 'Blob plain highlighted data.',
null: true null: true
field :raw_plain_data, GraphQL::STRING_TYPE, field :raw_plain_data, GraphQL::Types::String,
description: 'The raw content of the blob, if the blob is text data.', description: 'The raw content of the blob, if the blob is text data.',
null: true null: true
field :raw_path, GraphQL::STRING_TYPE, field :raw_path, GraphQL::Types::String,
description: 'Blob raw content endpoint path.', description: 'Blob raw content endpoint path.',
null: false null: false
field :size, GraphQL::INT_TYPE, field :size, GraphQL::Types::Int,
description: 'Blob size.', description: 'Blob size.',
null: false null: false
field :binary, GraphQL::BOOLEAN_TYPE, field :binary, GraphQL::Types::Boolean,
description: 'Shows whether the blob is binary.', description: 'Shows whether the blob is binary.',
method: :binary?, method: :binary?,
null: false null: false
field :name, GraphQL::STRING_TYPE, field :name, GraphQL::Types::String,
description: 'Blob name.', description: 'Blob name.',
null: true null: true
field :path, GraphQL::STRING_TYPE, field :path, GraphQL::Types::String,
description: 'Blob path.', description: 'Blob path.',
null: true null: true
...@@ -49,15 +49,15 @@ module Types ...@@ -49,15 +49,15 @@ module Types
description: 'Blob content rich viewer.', description: 'Blob content rich viewer.',
null: true null: true
field :mode, type: GraphQL::STRING_TYPE, field :mode, type: GraphQL::Types::String,
description: 'Blob mode.', description: 'Blob mode.',
null: true null: true
field :external_storage, type: GraphQL::STRING_TYPE, field :external_storage, type: GraphQL::Types::String,
description: 'Blob external storage.', description: 'Blob external storage.',
null: true null: true
field :rendered_as_text, type: GraphQL::BOOLEAN_TYPE, field :rendered_as_text, type: GraphQL::Types::Boolean,
description: 'Shows whether the blob is rendered as text.', description: 'Shows whether the blob is rendered as text.',
method: :rendered_as_text?, method: :rendered_as_text?,
null: false null: false
......
...@@ -8,9 +8,9 @@ module Types ...@@ -8,9 +8,9 @@ module Types
graphql_name 'TaskCompletionStatus' graphql_name 'TaskCompletionStatus'
description 'Completion status of tasks' description 'Completion status of tasks'
field :count, GraphQL::INT_TYPE, null: false, field :count, GraphQL::Types::Int, null: false,
description: 'Number of total tasks.' description: 'Number of total tasks.'
field :completed_count, GraphQL::INT_TYPE, null: false, field :completed_count, GraphQL::Types::Int, null: false,
description: 'Number of completed tasks.' description: 'Number of completed tasks.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -9,11 +9,11 @@ module Types ...@@ -9,11 +9,11 @@ module Types
connection_type_class(Types::CountableConnectionType) connection_type_class(Types::CountableConnectionType)
field :id, GraphQL::ID_TYPE, field :id, GraphQL::Types::ID,
null: false, null: false,
description: 'ID of the Terraform state.' description: 'ID of the Terraform state.'
field :name, GraphQL::STRING_TYPE, field :name, GraphQL::Types::String,
null: false, null: false,
description: 'Name of the Terraform state.' description: 'Name of the Terraform state.'
......
...@@ -9,7 +9,7 @@ module Types ...@@ -9,7 +9,7 @@ module Types
authorize :read_terraform_state authorize :read_terraform_state
field :id, GraphQL::ID_TYPE, field :id, GraphQL::Types::ID,
null: false, null: false,
description: 'ID of the Terraform state version.' description: 'ID of the Terraform state version.'
...@@ -17,7 +17,7 @@ module Types ...@@ -17,7 +17,7 @@ module Types
null: true, null: true,
description: 'The user that created this version.' description: 'The user that created this version.'
field :download_path, GraphQL::STRING_TYPE, field :download_path, GraphQL::Types::String,
null: true, null: true,
description: "URL for downloading the version's JSON file." description: "URL for downloading the version's JSON file."
...@@ -25,7 +25,7 @@ module Types ...@@ -25,7 +25,7 @@ module Types
null: true, null: true,
description: 'The job that created this version.' description: 'The job that created this version.'
field :serial, GraphQL::INT_TYPE, field :serial, GraphQL::Types::Int,
null: true, null: true,
description: 'Serial number of the version.', description: 'Serial number of the version.',
method: :version method: :version
......
...@@ -12,7 +12,7 @@ module Types ...@@ -12,7 +12,7 @@ module Types
description: 'Timestamp of when the time tracked was spent at.' description: 'Timestamp of when the time tracked was spent at.'
field :time_spent, field :time_spent,
GraphQL::INT_TYPE, GraphQL::Types::Int,
null: false, null: false,
description: 'The time spent displayed in seconds.' description: 'The time spent displayed in seconds.'
......
...@@ -9,7 +9,7 @@ module Types ...@@ -9,7 +9,7 @@ module Types
authorize :read_todo authorize :read_todo
field :id, GraphQL::ID_TYPE, field :id, GraphQL::Types::ID,
description: 'ID of the to-do item.', description: 'ID of the to-do item.',
null: false null: false
...@@ -35,7 +35,7 @@ module Types ...@@ -35,7 +35,7 @@ module Types
description: 'Target type of the to-do item.', description: 'Target type of the to-do item.',
null: false null: false
field :body, GraphQL::STRING_TYPE, field :body, GraphQL::Types::String,
description: 'Body of the to-do item.', description: 'Body of the to-do item.',
null: false, null: false,
calls_gitaly: true # TODO This is only true when `target_type` is `Commit`. See https://gitlab.com/gitlab-org/gitlab/issues/34757#note_234752665 calls_gitaly: true # TODO This is only true when `target_type` is `Commit`. See https://gitlab.com/gitlab-org/gitlab/issues/34757#note_234752665
......
...@@ -10,14 +10,14 @@ module Types ...@@ -10,14 +10,14 @@ module Types
graphql_name 'Blob' graphql_name 'Blob'
field :web_url, GraphQL::STRING_TYPE, null: true, field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL of the blob.' description: 'Web URL of the blob.'
field :web_path, GraphQL::STRING_TYPE, null: true, field :web_path, GraphQL::Types::String, null: true,
description: 'Web path of the blob.' description: 'Web path of the blob.'
field :lfs_oid, GraphQL::STRING_TYPE, null: true, field :lfs_oid, GraphQL::Types::String, null: true,
calls_gitaly: true, calls_gitaly: true,
description: 'LFS ID of the blob.' description: 'LFS ID of the blob.'
field :mode, GraphQL::STRING_TYPE, null: true, field :mode, GraphQL::Types::String, null: true,
description: 'Blob mode in numeric format.' description: 'Blob mode in numeric format.'
def lfs_oid def lfs_oid
......
...@@ -4,17 +4,17 @@ module Types ...@@ -4,17 +4,17 @@ module Types
module EntryType module EntryType
include Types::BaseInterface include Types::BaseInterface
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the entry.' description: 'ID of the entry.'
field :sha, GraphQL::STRING_TYPE, null: false, field :sha, GraphQL::Types::String, null: false,
description: 'Last commit SHA for the entry.', method: :id description: 'Last commit SHA for the entry.', method: :id
field :name, GraphQL::STRING_TYPE, null: false, field :name, GraphQL::Types::String, null: false,
description: 'Name of the entry.' description: 'Name of the entry.'
field :type, Tree::TypeEnum, null: false, field :type, Tree::TypeEnum, null: false,
description: 'Type of tree entry.' description: 'Type of tree entry.'
field :path, GraphQL::STRING_TYPE, null: false, field :path, GraphQL::Types::String, null: false,
description: 'Path of the entry.' description: 'Path of the entry.'
field :flat_path, GraphQL::STRING_TYPE, null: false, field :flat_path, GraphQL::Types::String, null: false,
description: 'Flat path of the entry.' description: 'Flat path of the entry.'
end end
end end
......
...@@ -8,9 +8,9 @@ module Types ...@@ -8,9 +8,9 @@ module Types
graphql_name 'Submodule' graphql_name 'Submodule'
field :web_url, type: GraphQL::STRING_TYPE, null: true, field :web_url, type: GraphQL::Types::String, null: true,
description: 'Web URL for the sub-module.' description: 'Web URL for the sub-module.'
field :tree_url, type: GraphQL::STRING_TYPE, null: true, field :tree_url, type: GraphQL::Types::String, null: true,
description: 'Tree URL for the sub-module.' description: 'Tree URL for the sub-module.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -11,9 +11,9 @@ module Types ...@@ -11,9 +11,9 @@ module Types
graphql_name 'TreeEntry' graphql_name 'TreeEntry'
description 'Represents a directory' description 'Represents a directory'
field :web_url, GraphQL::STRING_TYPE, null: true, field :web_url, GraphQL::Types::String, null: true,
description: 'Web URL for the tree entry (directory).' description: 'Web URL for the tree entry (directory).'
field :web_path, GraphQL::STRING_TYPE, null: true, field :web_path, GraphQL::Types::String, null: true,
description: 'Web path for the tree entry (directory).' description: 'Web path for the tree entry (directory).'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -14,20 +14,20 @@ module Types ...@@ -14,20 +14,20 @@ module Types
method: :itself method: :itself
field :id, field :id,
type: GraphQL::ID_TYPE, type: GraphQL::Types::ID,
null: false, null: false,
description: 'ID of the user.' description: 'ID of the user.'
field :bot, field :bot,
type: GraphQL::BOOLEAN_TYPE, type: GraphQL::Types::Boolean,
null: false, null: false,
description: 'Indicates if the user is a bot.', description: 'Indicates if the user is a bot.',
method: :bot? method: :bot?
field :username, field :username,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: false, null: false,
description: 'Username of the user. Unique within this instance of GitLab.' description: 'Username of the user. Unique within this instance of GitLab.'
field :name, field :name,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: false, null: false,
description: 'Human-readable name of the user.' description: 'Human-readable name of the user.'
field :state, field :state,
...@@ -35,24 +35,24 @@ module Types ...@@ -35,24 +35,24 @@ module Types
null: false, null: false,
description: 'State of the user.' description: 'State of the user.'
field :email, field :email,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: true, null: true,
description: 'User email.', method: :public_email, description: 'User email.', method: :public_email,
deprecated: { reason: :renamed, replacement: 'User.publicEmail', milestone: '13.7' } deprecated: { reason: :renamed, replacement: 'User.publicEmail', milestone: '13.7' }
field :public_email, field :public_email,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: true, null: true,
description: "User's public email." description: "User's public email."
field :avatar_url, field :avatar_url,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: true, null: true,
description: "URL of the user's avatar." description: "URL of the user's avatar."
field :web_url, field :web_url,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: false, null: false,
description: 'Web URL of the user.' description: 'Web URL of the user.'
field :web_path, field :web_path,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: false, null: false,
description: 'Web path of the user.' description: 'Web path of the user.'
field :todos, field :todos,
...@@ -70,7 +70,7 @@ module Types ...@@ -70,7 +70,7 @@ module Types
null: true, null: true,
description: 'User status.' description: 'User status.'
field :location, field :location,
type: ::GraphQL::STRING_TYPE, type: ::GraphQL::Types::String,
null: true, null: true,
description: 'The location of the user.' description: 'The location of the user.'
field :project_memberships, field :project_memberships,
......
...@@ -13,14 +13,14 @@ module Types ...@@ -13,14 +13,14 @@ module Types
authorize :read_merge_request authorize :read_merge_request
field :can_merge, field :can_merge,
type: ::GraphQL::BOOLEAN_TYPE, type: ::GraphQL::Types::Boolean,
null: false, null: false,
calls_gitaly: true, calls_gitaly: true,
method: :can_merge?, method: :can_merge?,
description: 'Whether this user can merge this merge request.' description: 'Whether this user can merge this merge request.'
field :can_update, field :can_update,
type: ::GraphQL::BOOLEAN_TYPE, type: ::GraphQL::Types::Boolean,
null: false, null: false,
method: :can_update?, method: :can_update?,
description: 'Whether this user can update this merge request.' description: 'Whether this user can update this merge request.'
...@@ -31,13 +31,13 @@ module Types ...@@ -31,13 +31,13 @@ module Types
description: 'The state of the review by this user.' description: 'The state of the review by this user.'
field :reviewed, field :reviewed,
type: ::GraphQL::BOOLEAN_TYPE, type: ::GraphQL::Types::Boolean,
null: false, null: false,
method: :reviewed?, method: :reviewed?,
description: 'Whether this user has provided a review for this merge request.' description: 'Whether this user has provided a review for this merge request.'
field :approved, field :approved,
type: ::GraphQL::BOOLEAN_TYPE, type: ::GraphQL::Types::Boolean,
null: false, null: false,
method: :approved?, method: :approved?,
description: 'Whether this user has approved this merge request.' description: 'Whether this user has approved this merge request.'
......
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
markdown_field :message_html, null: true, markdown_field :message_html, null: true,
description: 'HTML of the user status message' description: 'HTML of the user status message'
field :message, GraphQL::STRING_TYPE, null: true, field :message, GraphQL::Types::String, null: true,
description: 'User status message.' description: 'User status message.'
field :emoji, GraphQL::STRING_TYPE, null: true, field :emoji, GraphQL::Types::String, null: true,
description: 'String representation of emoji.' description: 'String representation of emoji.'
field :availability, Types::AvailabilityEnum, null: false, field :availability, Types::AvailabilityEnum, null: false,
description: 'User availability status.' description: 'User availability status.'
......
...@@ -133,20 +133,24 @@ For example, `app/graphql/types/issue_type.rb`: ...@@ -133,20 +133,24 @@ For example, `app/graphql/types/issue_type.rb`:
```ruby ```ruby
graphql_name 'Issue' graphql_name 'Issue'
field :iid, GraphQL::ID_TYPE, null: true field :iid, GraphQL::Types::ID, null: true
field :title, GraphQL::STRING_TYPE, null: true field :title, GraphQL::Types::String, null: true
# we also have a method here that we've defined, that extends `field` # we also have a method here that we've defined, that extends `field`
markdown_field :title_html, null: true markdown_field :title_html, null: true
field :description, GraphQL::STRING_TYPE, null: true field :description, GraphQL::Types::String, null: true
markdown_field :description_html, null: true markdown_field :description_html, null: true
``` ```
We give each type a name (in this case `Issue`). We give each type a name (in this case `Issue`).
The `iid`, `title` and `description` are _scalar_ GraphQL types. The `iid`, `title` and `description` are _scalar_ GraphQL types.
`iid` is a `GraphQL::ID_TYPE`, a special string type that signifies a unique ID. `iid` is a `GraphQL::Types::ID`, a special string type that signifies a unique ID.
`title` and `description` are regular `GraphQL::STRING_TYPE` types. `title` and `description` are regular `GraphQL::Types::String` types.
Note that the old scalar types `GraphQL:ID`, `GraphQL::INT_TYPE`, `GraphQL::STRING_TYPE`,
and `GraphQL:BOOLEAN_TYPE` are no longer allowed. Please use `GraphQL::Types::ID`,
`GraphQL::Types::Int`, `GraphQL::Types::String`, and `GraphQL::Types::Boolean`.
When exposing a model through the GraphQL API, we do so by creating a When exposing a model through the GraphQL API, we do so by creating a
new type in `app/graphql/types`. You can also declare custom GraphQL data types new type in `app/graphql/types`. You can also declare custom GraphQL data types
...@@ -225,7 +229,7 @@ Using an example from ...@@ -225,7 +229,7 @@ Using an example from
[`Types::Notes::DiscussionType`](https://gitlab.com/gitlab-org/gitlab/-/blob/3c95bd9/app/graphql/types/notes/discussion_type.rb#L24-26): [`Types::Notes::DiscussionType`](https://gitlab.com/gitlab-org/gitlab/-/blob/3c95bd9/app/graphql/types/notes/discussion_type.rb#L24-26):
```ruby ```ruby
field :reply_id, GraphQL::ID_TYPE field :reply_id, GraphQL::Types::ID
def reply_id def reply_id
::Gitlab::GlobalId.build(object, id: object.reply_id) ::Gitlab::GlobalId.build(object, id: object.reply_id)
...@@ -402,7 +406,7 @@ class BranchResolver < BaseResolver ...@@ -402,7 +406,7 @@ class BranchResolver < BaseResolver
type ::Types::BranchType, null: true type ::Types::BranchType, null: true
calls_gitaly! calls_gitaly!
argument name: ::GraphQL::STRING_TYPE, required: true argument name: ::GraphQL::Types::String, required: true
def resolve(name:) def resolve(name:)
object.branch(name) object.branch(name)
...@@ -499,7 +503,7 @@ everyone. ...@@ -499,7 +503,7 @@ everyone.
Example: Example:
```ruby ```ruby
field :test_field, type: GraphQL::STRING_TYPE, field :test_field, type: GraphQL::Types::String,
null: true, null: true,
description: 'Some test field.', description: 'Some test field.',
feature_flag: :my_feature_flag feature_flag: :my_feature_flag
...@@ -523,7 +527,7 @@ When applying a feature flag to toggle the value of a field, the ...@@ -523,7 +527,7 @@ When applying a feature flag to toggle the value of a field, the
Example: Example:
```ruby ```ruby
field :foo, GraphQL::STRING_TYPE, field :foo, GraphQL::Types::String,
null: true, null: true,
description: 'Some test field. Will always return `null`' \ description: 'Some test field. Will always return `null`' \
'if `my_feature_flag` feature flag is disabled.' 'if `my_feature_flag` feature flag is disabled.'
...@@ -553,7 +557,7 @@ The value of the property is a `Hash` of: ...@@ -553,7 +557,7 @@ The value of the property is a `Hash` of:
Example: Example:
```ruby ```ruby
field :token, GraphQL::STRING_TYPE, null: true, field :token, GraphQL::Types::String, null: true,
deprecated: { reason: 'Login via token has been removed', milestone: '10.0' }, deprecated: { reason: 'Login via token has been removed', milestone: '10.0' },
description: 'Token for login.' description: 'Token for login.'
``` ```
...@@ -795,15 +799,15 @@ We can use GraphQL types like this: ...@@ -795,15 +799,15 @@ We can use GraphQL types like this:
```ruby ```ruby
module Types module Types
class ChartType < BaseObject class ChartType < BaseObject
field :title, GraphQL::STRING_TYPE, null: true, description: 'Title of the chart.' field :title, GraphQL::Types::String, null: true, description: 'Title of the chart.'
field :data, [Types::ChartDatumType], null: true, description: 'Data of the chart.' field :data, [Types::ChartDatumType], null: true, description: 'Data of the chart.'
end end
end end
module Types module Types
class ChartDatumType < BaseObject class ChartDatumType < BaseObject
field :x, GraphQL::INT_TYPE, null: true, description: 'X-axis value of the chart datum.' field :x, GraphQL::Types::Int, null: true, description: 'X-axis value of the chart datum.'
field :y, GraphQL::INT_TYPE, null: true, description: 'Y-axis value of the chart datum.' field :y, GraphQL::Types::Int, null: true, description: 'Y-axis value of the chart datum.'
end end
end end
``` ```
...@@ -817,7 +821,7 @@ A description of a field or argument is given using the `description:` ...@@ -817,7 +821,7 @@ A description of a field or argument is given using the `description:`
keyword. For example: keyword. For example:
```ruby ```ruby
field :id, GraphQL::ID_TYPE, description: 'ID of the resource.' field :id, GraphQL::Types::ID, description: 'ID of the resource.'
``` ```
Descriptions of fields and arguments are viewable to users through: Descriptions of fields and arguments are viewable to users through:
...@@ -834,7 +838,7 @@ descriptions: ...@@ -834,7 +838,7 @@ descriptions:
`'Labels of the issue'` (issue being the resource). `'Labels of the issue'` (issue being the resource).
- Use `"{x} of the {y}"` where possible. Example: `'Title of the issue'`. - Use `"{x} of the {y}"` where possible. Example: `'Title of the issue'`.
Do not start descriptions with `The`. Do not start descriptions with `The`.
- Descriptions of `GraphQL::BOOLEAN_TYPE` fields should answer the question: "What does - Descriptions of `GraphQL::Types::Boolean` fields should answer the question: "What does
this field do?". Example: `'Indicates project has a Git repository'`. this field do?". Example: `'Indicates project has a Git repository'`.
- Always include the word `"timestamp"` when describing an argument or - Always include the word `"timestamp"` when describing an argument or
field of type `Types::TimeType`. This lets the reader know that the field of type `Types::TimeType`. This lets the reader know that the
...@@ -844,8 +848,8 @@ descriptions: ...@@ -844,8 +848,8 @@ descriptions:
Example: Example:
```ruby ```ruby
field :id, GraphQL::ID_TYPE, description: 'ID of the issue.' field :id, GraphQL::Types::ID, description: 'ID of the issue.'
field :confidential, GraphQL::BOOLEAN_TYPE, description: 'Indicates the issue is confidential.' field :confidential, GraphQL::Types::Boolean, description: 'Indicates the issue is confidential.'
field :closed_at, Types::TimeType, description: 'Timestamp of when the issue was closed.' field :closed_at, Types::TimeType, description: 'Timestamp of when the issue was closed.'
``` ```
...@@ -861,7 +865,7 @@ passing it the type, and field name to copy the description of. ...@@ -861,7 +865,7 @@ passing it the type, and field name to copy the description of.
Example: Example:
```ruby ```ruby
argument :title, GraphQL::STRING_TYPE, argument :title, GraphQL::Types::String,
required: false, required: false,
description: copy_field_description(Types::MergeRequestType, :title) description: copy_field_description(Types::MergeRequestType, :title)
``` ```
...@@ -874,7 +878,7 @@ provide a `see` property on fields. For example: ...@@ -874,7 +878,7 @@ provide a `see` property on fields. For example:
```ruby ```ruby
field :genus, field :genus,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: true, null: true,
description: 'A taxonomic genus.' description: 'A taxonomic genus.'
see: { 'Wikipedia page on genera' => 'https://wikipedia.org/wiki/Genus' } see: { 'Wikipedia page on genera' => 'https://wikipedia.org/wiki/Genus' }
...@@ -923,7 +927,7 @@ class PostResolver < BaseResolver ...@@ -923,7 +927,7 @@ class PostResolver < BaseResolver
authorize :read_blog authorize :read_blog
description 'Blog posts, optionally filtered by name' description 'Blog posts, optionally filtered by name'
argument :name, [::GraphQL::STRING_TYPE], required: false, as: :slug argument :name, [::GraphQL::Types::String], required: false, as: :slug
alias_method :blog, :object alias_method :blog, :object
...@@ -1015,10 +1019,10 @@ class JobsResolver < BaseResolver ...@@ -1015,10 +1019,10 @@ class JobsResolver < BaseResolver
type JobType.connection_type, null: true type JobType.connection_type, null: true
authorize :read_pipeline authorize :read_pipeline
argument :name, [::GraphQL::STRING_TYPE], required: false argument :name, [::GraphQL::Types::String], required: false
when_single do when_single do
argument :name, ::GraphQL::STRING_TYPE, required: true argument :name, ::GraphQL::Types::String, required: true
end end
def resolve(**args) def resolve(**args)
...@@ -1039,13 +1043,13 @@ class JobsResolver < BaseResolver ...@@ -1039,13 +1043,13 @@ class JobsResolver < BaseResolver
type JobType.connection_type, null: true type JobType.connection_type, null: true
authorize :read_pipeline authorize :read_pipeline
argument :name, [::GraphQL::STRING_TYPE], required: false argument :name, [::GraphQL::Types::String], required: false
argument :id, [::Types::GlobalIDType[::Job]], argument :id, [::Types::GlobalIDType[::Job]],
required: false, required: false,
prepare: ->(ids, ctx) { ids.map(&:model_id) } prepare: ->(ids, ctx) { ids.map(&:model_id) }
when_single do when_single do
argument :name, ::GraphQL::STRING_TYPE, required: false argument :name, ::GraphQL::Types::String, required: false
argument :id, ::Types::GlobalIDType[::Job], argument :id, ::Types::GlobalIDType[::Job],
required: false required: false
prepare: ->(id, ctx) { id.model_id } prepare: ->(id, ctx) { id.model_id }
...@@ -1357,7 +1361,7 @@ Arguments for a mutation are defined using `argument`. ...@@ -1357,7 +1361,7 @@ Arguments for a mutation are defined using `argument`.
Example: Example:
```ruby ```ruby
argument :my_arg, GraphQL::STRING_TYPE, argument :my_arg, GraphQL::Types::String,
required: true, required: true,
description: "A description of the argument." description: "A description of the argument."
``` ```
...@@ -1382,16 +1386,16 @@ defines these arguments (some ...@@ -1382,16 +1386,16 @@ defines these arguments (some
[through inheritance](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/graphql/mutations/merge_requests/base.rb)): [through inheritance](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/graphql/mutations/merge_requests/base.rb)):
```ruby ```ruby
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: "The project the merge request to mutate is in." description: "The project the merge request to mutate is in."
argument :iid, GraphQL::STRING_TYPE, argument :iid, GraphQL::Types::String,
required: true, required: true,
description: "The IID of the merge request to mutate." description: "The IID of the merge request to mutate."
argument :draft, argument :draft,
GraphQL::BOOLEAN_TYPE, GraphQL::Types::Boolean,
required: false, required: false,
description: <<~DESC description: <<~DESC
Whether or not to set the merge request as a draft. Whether or not to set the merge request as a draft.
......
...@@ -480,7 +480,7 @@ module EE ...@@ -480,7 +480,7 @@ module EE
prepended do prepended do
argument :name, argument :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: 'Tanuki name' description: 'Tanuki name'
end end
......
...@@ -142,7 +142,7 @@ to view the `secretName` field: ...@@ -142,7 +142,7 @@ to view the `secretName` field:
```ruby ```ruby
module Types module Types
class ProjectType < BaseObject class ProjectType < BaseObject
field :secret_name, ::GraphQL::STRING_TYPE, null: true, authorize: :owner_access field :secret_name, ::GraphQL::Types::String, null: true, authorize: :owner_access
end end
end end
``` ```
...@@ -179,7 +179,7 @@ as an array instead of as a single value: ...@@ -179,7 +179,7 @@ as an array instead of as a single value:
```ruby ```ruby
module Types module Types
class MyType < BaseObject class MyType < BaseObject
field :hidden_field, ::GraphQL::INT_TYPE, field :hidden_field, ::GraphQL::Types::Int,
null: true, null: true,
authorize: [:owner_access, :another_ability] authorize: [:owner_access, :another_ability]
end end
......
...@@ -29,7 +29,7 @@ For example, to load a `User` by `username`, we can add batching as follows: ...@@ -29,7 +29,7 @@ For example, to load a `User` by `username`, we can add batching as follows:
```ruby ```ruby
class UserResolver < BaseResolver class UserResolver < BaseResolver
type UserType, null: true type UserType, null: true
argument :username, ::GraphQL::STRING_TYPE, required: true argument :username, ::GraphQL::Types::String, required: true
def resolve(**args) def resolve(**args)
BatchLoader::GraphQL.for(username).batch do |usernames, loader| BatchLoader::GraphQL.for(username).batch do |usernames, loader|
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe ::Types::RangeInputType do RSpec.describe ::Types::RangeInputType do
let(:of_integer) { ::GraphQL::INT_TYPE } let(:of_integer) { ::GraphQL::Types::Int }
context 'parameterized on Integer' do context 'parameterized on Integer' do
let(:type) { described_class[of_integer] } let(:type) { described_class[of_integer] }
...@@ -32,12 +32,12 @@ RSpec.describe ::Types::RangeInputType do ...@@ -32,12 +32,12 @@ RSpec.describe ::Types::RangeInputType do
expect(instance).to be_a_kind_of(described_class) expect(instance).to be_a_kind_of(described_class)
expect(instance).to be_a_kind_of(described_class[of_integer]) expect(instance).to be_a_kind_of(described_class[of_integer])
expect(instance).not_to be_a_kind_of(described_class[GraphQL::ID_TYPE]) expect(instance).not_to be_a_kind_of(described_class[GraphQL::Types::ID])
end end
it 'follows expected subtyping relationships for classes' do it 'follows expected subtyping relationships for classes' do
expect(described_class[of_integer]).to be < described_class expect(described_class[of_integer]).to be < described_class
expect(described_class[of_integer]).not_to be < described_class[GraphQL::ID_TYPE] expect(described_class[of_integer]).not_to be < described_class[GraphQL::Types::ID]
expect(described_class[of_integer]).not_to be < described_class[of_integer, false] expect(described_class[of_integer]).not_to be < described_class[of_integer, false]
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment