Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dad47460
Commit
dad47460
authored
Jul 20, 2021
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert old graphql types to newer types
in prep for interpreter
parent
fed6566c
Changes
64
Hide whitespace changes
Inline
Side-by-side
Showing
64 changed files
with
139 additions
and
177 deletions
+139
-177
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-39
app/graphql/resolvers/alert_management/alert_resolver.rb
app/graphql/resolvers/alert_management/alert_resolver.rb
+3
-3
app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb
...esolvers/alert_management/alert_status_counts_resolver.rb
+2
-2
app/graphql/resolvers/blobs_resolver.rb
app/graphql/resolvers/blobs_resolver.rb
+2
-2
app/graphql/resolvers/ci/config_resolver.rb
app/graphql/resolvers/ci/config_resolver.rb
+4
-4
app/graphql/resolvers/ci/runner_setup_resolver.rb
app/graphql/resolvers/ci/runner_setup_resolver.rb
+2
-2
app/graphql/resolvers/ci/runners_resolver.rb
app/graphql/resolvers/ci/runners_resolver.rb
+2
-2
app/graphql/resolvers/ci/template_resolver.rb
app/graphql/resolvers/ci/template_resolver.rb
+1
-1
app/graphql/resolvers/ci/test_suite_resolver.rb
app/graphql/resolvers/ci/test_suite_resolver.rb
+1
-1
app/graphql/resolvers/concerns/group_issuable_resolver.rb
app/graphql/resolvers/concerns/group_issuable_resolver.rb
+1
-1
app/graphql/resolvers/concerns/issue_resolver_arguments.rb
app/graphql/resolvers/concerns/issue_resolver_arguments.rb
+9
-9
app/graphql/resolvers/concerns/resolves_pipelines.rb
app/graphql/resolvers/concerns/resolves_pipelines.rb
+2
-2
app/graphql/resolvers/container_repositories_resolver.rb
app/graphql/resolvers/container_repositories_resolver.rb
+1
-1
app/graphql/resolvers/design_management/design_resolver.rb
app/graphql/resolvers/design_management/design_resolver.rb
+1
-1
app/graphql/resolvers/design_management/designs_resolver.rb
app/graphql/resolvers/design_management/designs_resolver.rb
+1
-1
app/graphql/resolvers/design_management/version/design_at_version_resolver.rb
...s/design_management/version/design_at_version_resolver.rb
+1
-1
app/graphql/resolvers/design_management/version/designs_at_version_resolver.rb
.../design_management/version/designs_at_version_resolver.rb
+1
-1
app/graphql/resolvers/design_management/version_in_collection_resolver.rb
...lvers/design_management/version_in_collection_resolver.rb
+1
-1
app/graphql/resolvers/design_management/versions_resolver.rb
app/graphql/resolvers/design_management/versions_resolver.rb
+1
-1
app/graphql/resolvers/echo_resolver.rb
app/graphql/resolvers/echo_resolver.rb
+2
-2
app/graphql/resolvers/environments_resolver.rb
app/graphql/resolvers/environments_resolver.rb
+3
-3
app/graphql/resolvers/error_tracking/sentry_errors_resolver.rb
...raphql/resolvers/error_tracking/sentry_errors_resolver.rb
+2
-2
app/graphql/resolvers/full_path_resolver.rb
app/graphql/resolvers/full_path_resolver.rb
+1
-1
app/graphql/resolvers/group_labels_resolver.rb
app/graphql/resolvers/group_labels_resolver.rb
+2
-2
app/graphql/resolvers/group_milestones_resolver.rb
app/graphql/resolvers/group_milestones_resolver.rb
+2
-2
app/graphql/resolvers/labels_resolver.rb
app/graphql/resolvers/labels_resolver.rb
+2
-2
app/graphql/resolvers/members_resolver.rb
app/graphql/resolvers/members_resolver.rb
+1
-1
app/graphql/resolvers/merge_request_resolver.rb
app/graphql/resolvers/merge_request_resolver.rb
+1
-1
app/graphql/resolvers/merge_requests_resolver.rb
app/graphql/resolvers/merge_requests_resolver.rb
+10
-10
app/graphql/resolvers/metrics/dashboard_resolver.rb
app/graphql/resolvers/metrics/dashboard_resolver.rb
+1
-1
app/graphql/resolvers/milestones_resolver.rb
app/graphql/resolvers/milestones_resolver.rb
+3
-3
app/graphql/resolvers/namespace_projects_resolver.rb
app/graphql/resolvers/namespace_projects_resolver.rb
+3
-3
app/graphql/resolvers/packages_base_resolver.rb
app/graphql/resolvers/packages_base_resolver.rb
+2
-2
app/graphql/resolvers/project_milestones_resolver.rb
app/graphql/resolvers/project_milestones_resolver.rb
+1
-1
app/graphql/resolvers/project_pipeline_resolver.rb
app/graphql/resolvers/project_pipeline_resolver.rb
+2
-2
app/graphql/resolvers/projects/jira_projects_resolver.rb
app/graphql/resolvers/projects/jira_projects_resolver.rb
+1
-1
app/graphql/resolvers/projects/services_resolver.rb
app/graphql/resolvers/projects/services_resolver.rb
+1
-1
app/graphql/resolvers/projects_resolver.rb
app/graphql/resolvers/projects_resolver.rb
+6
-6
app/graphql/resolvers/release_resolver.rb
app/graphql/resolvers/release_resolver.rb
+1
-1
app/graphql/resolvers/repository_branch_names_resolver.rb
app/graphql/resolvers/repository_branch_names_resolver.rb
+4
-4
app/graphql/resolvers/snippets/blobs_resolver.rb
app/graphql/resolvers/snippets/blobs_resolver.rb
+1
-1
app/graphql/resolvers/snippets_resolver.rb
app/graphql/resolvers/snippets_resolver.rb
+1
-1
app/graphql/resolvers/terraform/states_resolver.rb
app/graphql/resolvers/terraform/states_resolver.rb
+1
-1
app/graphql/resolvers/todo_resolver.rb
app/graphql/resolvers/todo_resolver.rb
+3
-3
app/graphql/resolvers/tree_resolver.rb
app/graphql/resolvers/tree_resolver.rb
+3
-3
app/graphql/resolvers/user_discussions_count_resolver.rb
app/graphql/resolvers/user_discussions_count_resolver.rb
+1
-1
app/graphql/resolvers/user_merge_requests_resolver_base.rb
app/graphql/resolvers/user_merge_requests_resolver_base.rb
+1
-1
app/graphql/resolvers/user_notes_count_resolver.rb
app/graphql/resolvers/user_notes_count_resolver.rb
+1
-1
app/graphql/resolvers/user_resolver.rb
app/graphql/resolvers/user_resolver.rb
+1
-1
app/graphql/resolvers/user_starred_projects_resolver.rb
app/graphql/resolvers/user_starred_projects_resolver.rb
+1
-1
app/graphql/resolvers/users/group_count_resolver.rb
app/graphql/resolvers/users/group_count_resolver.rb
+1
-1
app/graphql/resolvers/users_resolver.rb
app/graphql/resolvers/users_resolver.rb
+4
-4
ee/spec/graphql/resolvers/user_discussions_count_resolver_spec.rb
...graphql/resolvers/user_discussions_count_resolver_spec.rb
+1
-1
ee/spec/graphql/resolvers/user_notes_count_resolver_spec.rb
ee/spec/graphql/resolvers/user_notes_count_resolver_spec.rb
+1
-1
spec/graphql/resolvers/base_resolver_spec.rb
spec/graphql/resolvers/base_resolver_spec.rb
+19
-19
spec/graphql/resolvers/concerns/caching_array_resolver_spec.rb
...graphql/resolvers/concerns/caching_array_resolver_spec.rb
+2
-2
spec/graphql/resolvers/concerns/resolves_pipelines_spec.rb
spec/graphql/resolvers/concerns/resolves_pipelines_spec.rb
+1
-1
spec/graphql/resolvers/echo_resolver_spec.rb
spec/graphql/resolvers/echo_resolver_spec.rb
+1
-1
spec/graphql/resolvers/issues_resolver_spec.rb
spec/graphql/resolvers/issues_resolver_spec.rb
+1
-1
spec/graphql/resolvers/namespace_projects_resolver_spec.rb
spec/graphql/resolvers/namespace_projects_resolver_spec.rb
+1
-1
spec/graphql/resolvers/project_resolver_spec.rb
spec/graphql/resolvers/project_resolver_spec.rb
+2
-2
spec/graphql/resolvers/terraform/states_resolver_spec.rb
spec/graphql/resolvers/terraform/states_resolver_spec.rb
+2
-1
spec/graphql/resolvers/user_discussions_count_resolver_spec.rb
...graphql/resolvers/user_discussions_count_resolver_spec.rb
+1
-1
spec/graphql/resolvers/user_notes_count_resolver_spec.rb
spec/graphql/resolvers/user_notes_count_resolver_spec.rb
+1
-1
No files found.
.rubocop_manual_todo.yml
View file @
dad47460
...
...
@@ -90,45 +90,6 @@ Graphql/OldTypes:
-
'
app/graphql/mutations/snippets/create.rb'
-
'
app/graphql/mutations/snippets/update.rb'
-
'
app/graphql/mutations/user_callouts/create.rb'
-
'
app/graphql/resolvers/alert_management/alert_resolver.rb'
-
'
app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb'
-
'
app/graphql/resolvers/blobs_resolver.rb'
-
'
app/graphql/resolvers/ci/config_resolver.rb'
-
'
app/graphql/resolvers/ci/runners_resolver.rb'
-
'
app/graphql/resolvers/ci/template_resolver.rb'
-
'
app/graphql/resolvers/concerns/group_issuable_resolver.rb'
-
'
app/graphql/resolvers/concerns/issue_resolver_arguments.rb'
-
'
app/graphql/resolvers/concerns/resolves_pipelines.rb'
-
'
app/graphql/resolvers/container_repositories_resolver.rb'
-
'
app/graphql/resolvers/design_management/design_resolver.rb'
-
'
app/graphql/resolvers/design_management/version/design_at_version_resolver.rb'
-
'
app/graphql/resolvers/design_management/version_in_collection_resolver.rb'
-
'
app/graphql/resolvers/design_management/versions_resolver.rb'
-
'
app/graphql/resolvers/environments_resolver.rb'
-
'
app/graphql/resolvers/full_path_resolver.rb'
-
'
app/graphql/resolvers/group_labels_resolver.rb'
-
'
app/graphql/resolvers/group_milestones_resolver.rb'
-
'
app/graphql/resolvers/labels_resolver.rb'
-
'
app/graphql/resolvers/members_resolver.rb'
-
'
app/graphql/resolvers/merge_request_resolver.rb'
-
'
app/graphql/resolvers/merge_requests_resolver.rb'
-
'
app/graphql/resolvers/metrics/dashboard_resolver.rb'
-
'
app/graphql/resolvers/milestones_resolver.rb'
-
'
app/graphql/resolvers/namespace_projects_resolver.rb'
-
'
app/graphql/resolvers/packages_base_resolver.rb'
-
'
app/graphql/resolvers/project_milestones_resolver.rb'
-
'
app/graphql/resolvers/project_pipeline_resolver.rb'
-
'
app/graphql/resolvers/projects/jira_projects_resolver.rb'
-
'
app/graphql/resolvers/projects/services_resolver.rb'
-
'
app/graphql/resolvers/projects_resolver.rb'
-
'
app/graphql/resolvers/release_resolver.rb'
-
'
app/graphql/resolvers/repository_branch_names_resolver.rb'
-
'
app/graphql/resolvers/snippets_resolver.rb'
-
'
app/graphql/resolvers/terraform/states_resolver.rb'
-
'
app/graphql/resolvers/tree_resolver.rb'
-
'
app/graphql/resolvers/user_resolver.rb'
-
'
app/graphql/resolvers/user_starred_projects_resolver.rb'
-
'
app/graphql/resolvers/users_resolver.rb'
-
'
app/graphql/types/access_level_type.rb'
-
'
app/graphql/types/admin/analytics/usage_trends/measurement_type.rb'
-
'
app/graphql/types/admin/sidekiq_queues/delete_jobs_response_type.rb'
...
...
app/graphql/resolvers/alert_management/alert_resolver.rb
View file @
dad47460
...
...
@@ -5,7 +5,7 @@ module Resolvers
class
AlertResolver
<
BaseResolver
include
LooksAhead
argument
:iid
,
GraphQL
::
STRING_TYPE
,
argument
:iid
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'IID of the alert. For example, "1".'
...
...
@@ -23,11 +23,11 @@ module Resolvers
required:
true
,
default_value:
'operations'
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
description:
'Search query for title, description, service, or monitoring_tool.'
,
required:
false
argument
:assignee_username
,
GraphQL
::
STRING_TYPE
,
argument
:assignee_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of a user assigned to the issue.'
...
...
app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb
View file @
dad47460
...
...
@@ -5,11 +5,11 @@ module Resolvers
class
AlertStatusCountsResolver
<
BaseResolver
type
Types
::
AlertManagement
::
AlertStatusCountsType
,
null:
true
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
description:
'Search query for title, description, service, or monitoring_tool.'
,
required:
false
argument
:assignee_username
,
GraphQL
::
STRING_TYPE
,
argument
:assignee_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of a user assigned to the issue.'
...
...
app/graphql/resolvers/blobs_resolver.rb
View file @
dad47460
...
...
@@ -10,10 +10,10 @@ module Resolvers
alias_method
:repository
,
:object
argument
:paths
,
[
GraphQL
::
STRING_TYPE
],
argument
:paths
,
[
GraphQL
::
Types
::
String
],
required:
true
,
description:
'Array of desired blob paths.'
argument
:ref
,
GraphQL
::
STRING_TYPE
,
argument
:ref
,
GraphQL
::
Types
::
String
,
required:
false
,
default_value:
nil
,
description:
'The commit ref to get the blobs from. Default value is HEAD.'
...
...
app/graphql/resolvers/ci/config_resolver.rb
View file @
dad47460
...
...
@@ -14,19 +14,19 @@ module Resolvers
authorize
:read_pipeline
argument
:project_path
,
GraphQL
::
ID_TYPE
,
argument
:project_path
,
GraphQL
::
Types
::
ID
,
required:
true
,
description:
'The project of the CI config.'
argument
:sha
,
GraphQL
::
STRING_TYPE
,
argument
:sha
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
"Sha for the pipeline."
argument
:content
,
GraphQL
::
STRING_TYPE
,
argument
:content
,
GraphQL
::
Types
::
String
,
required:
true
,
description:
"Contents of `.gitlab-ci.yml`."
argument
:dry_run
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:dry_run
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Run pipeline creation simulation, or only do static check.'
...
...
app/graphql/resolvers/ci/runner_setup_resolver.rb
View file @
dad47460
...
...
@@ -9,12 +9,12 @@ module Resolvers
description
'Runner setup instructions.'
argument
:platform
,
type:
GraphQL
::
STRING_TYPE
,
type:
GraphQL
::
Types
::
String
,
required:
true
,
description:
'Platform to generate the instructions for.'
argument
:architecture
,
type:
GraphQL
::
STRING_TYPE
,
type:
GraphQL
::
Types
::
String
,
required:
true
,
description:
'Architecture to generate the instructions for.'
...
...
app/graphql/resolvers/ci/runners_resolver.rb
View file @
dad47460
...
...
@@ -15,11 +15,11 @@ module Resolvers
required:
false
,
description:
'Filter runners by type.'
argument
:tag_list
,
[
GraphQL
::
STRING_TYPE
],
argument
:tag_list
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Filter by tags associated with the runner (comma-separated or array).'
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Filter by full token or partial text in description field.'
...
...
app/graphql/resolvers/ci/template_resolver.rb
View file @
dad47460
...
...
@@ -5,7 +5,7 @@ module Resolvers
class
TemplateResolver
<
BaseResolver
type
Types
::
Ci
::
TemplateType
,
null:
true
argument
:name
,
GraphQL
::
STRING_TYPE
,
required:
true
,
argument
:name
,
GraphQL
::
Types
::
String
,
required:
true
,
description:
'Name of the CI/CD template to search for. Template must be formatted as `Name.gitlab-ci.yml`.'
alias_method
:project
,
:object
...
...
app/graphql/resolvers/ci/test_suite_resolver.rb
View file @
dad47460
...
...
@@ -11,7 +11,7 @@ module Resolvers
alias_method
:pipeline
,
:object
argument
:build_ids
,
[
GraphQL
::
ID_TYPE
],
argument
:build_ids
,
[
GraphQL
::
Types
::
ID
],
required:
true
,
description:
'IDs of the builds used to run the test suite.'
...
...
app/graphql/resolvers/concerns/group_issuable_resolver.rb
View file @
dad47460
...
...
@@ -5,7 +5,7 @@ module GroupIssuableResolver
class_methods
do
def
include_subgroups
(
name_of_things
)
argument
:include_subgroups
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_subgroups
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
default_value:
false
,
description:
"Include
#{
name_of_things
}
belonging to subgroups"
...
...
app/graphql/resolvers/concerns/issue_resolver_arguments.rb
View file @
dad47460
...
...
@@ -6,29 +6,29 @@ module IssueResolverArguments
prepended
do
include
LooksAhead
argument
:iid
,
GraphQL
::
STRING_TYPE
,
argument
:iid
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'IID of the issue. For example, "1".'
argument
:iids
,
[
GraphQL
::
STRING_TYPE
],
argument
:iids
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'List of IIDs of issues. For example, `["1", "2"]`.'
argument
:label_name
,
[
GraphQL
::
STRING_TYPE
,
null:
true
],
argument
:label_name
,
[
GraphQL
::
Types
::
String
,
null:
true
],
required:
false
,
description:
'Labels applied to this issue.'
argument
:milestone_title
,
[
GraphQL
::
STRING_TYPE
,
null:
true
],
argument
:milestone_title
,
[
GraphQL
::
Types
::
String
,
null:
true
],
required:
false
,
description:
'Milestone applied to this issue.'
argument
:author_username
,
GraphQL
::
STRING_TYPE
,
argument
:author_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of the author of the issue.'
argument
:assignee_username
,
GraphQL
::
STRING_TYPE
,
argument
:assignee_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of a user assigned to the issue.'
,
deprecated:
{
reason:
'Use `assigneeUsernames`'
,
milestone:
'13.11'
}
argument
:assignee_usernames
,
[
GraphQL
::
STRING_TYPE
],
argument
:assignee_usernames
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Usernames of users assigned to the issue.'
argument
:assignee_id
,
GraphQL
::
STRING_TYPE
,
argument
:assignee_id
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'ID of a user assigned to the issues, "none" and "any" values are supported.'
argument
:created_before
,
Types
::
TimeType
,
...
...
@@ -49,7 +49,7 @@ module IssueResolverArguments
argument
:closed_after
,
Types
::
TimeType
,
required:
false
,
description:
'Issues closed after this date.'
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Search query for issue title or description.'
argument
:types
,
[
Types
::
IssueTypeEnum
],
...
...
app/graphql/resolvers/concerns/resolves_pipelines.rb
View file @
dad47460
...
...
@@ -10,11 +10,11 @@ module ResolvesPipelines
required:
false
,
description:
"Filter pipelines by their status."
argument
:ref
,
GraphQL
::
STRING_TYPE
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
"Filter pipelines by the ref they are run for."
argument
:sha
,
GraphQL
::
STRING_TYPE
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
"Filter pipelines by the sha of the commit they are run for."
end
...
...
app/graphql/resolvers/container_repositories_resolver.rb
View file @
dad47460
...
...
@@ -6,7 +6,7 @@ module Resolvers
type
Types
::
ContainerRepositoryType
,
null:
true
argument
:name
,
GraphQL
::
STRING_TYPE
,
argument
:name
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Filter the container repositories by their name.'
...
...
app/graphql/resolvers/design_management/design_resolver.rb
View file @
dad47460
...
...
@@ -11,7 +11,7 @@ module Resolvers
required:
false
,
description:
'Find a design by its ID.'
argument
:filename
,
GraphQL
::
STRING_TYPE
,
argument
:filename
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Find a design by its filename.'
...
...
app/graphql/resolvers/design_management/designs_resolver.rb
View file @
dad47460
...
...
@@ -11,7 +11,7 @@ module Resolvers
argument
:ids
,
[
DesignID
],
required:
false
,
description:
'Filters designs by their ID.'
argument
:filenames
,
[
GraphQL
::
STRING_TYPE
],
argument
:filenames
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Filters designs by their filename.'
argument
:at_version
,
VersionID
,
...
...
app/graphql/resolvers/design_management/version/design_at_version_resolver.rb
View file @
dad47460
...
...
@@ -23,7 +23,7 @@ module Resolvers
argument
:design_id
,
DesignID
,
required:
false
,
description:
'The ID of a specific design.'
argument
:filename
,
GraphQL
::
STRING_TYPE
,
argument
:filename
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'The filename of a specific design.'
...
...
app/graphql/resolvers/design_management/version/designs_at_version_resolver.rb
View file @
dad47460
...
...
@@ -17,7 +17,7 @@ module Resolvers
required:
false
,
description:
'Filters designs by their ID.'
argument
:filenames
,
[
GraphQL
::
STRING_TYPE
],
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Filters designs by their filename.'
...
...
app/graphql/resolvers/design_management/version_in_collection_resolver.rb
View file @
dad47460
...
...
@@ -15,7 +15,7 @@ module Resolvers
VersionID
=
::
Types
::
GlobalIDType
[
::
DesignManagement
::
Version
]
argument
:sha
,
GraphQL
::
STRING_TYPE
,
argument
:sha
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
"The SHA256 of a specific version."
argument
:id
,
VersionID
,
...
...
app/graphql/resolvers/design_management/versions_resolver.rb
View file @
dad47460
...
...
@@ -11,7 +11,7 @@ module Resolvers
extras
[
:parent
]
argument
:earlier_or_equal_to_sha
,
GraphQL
::
STRING_TYPE
,
argument
:earlier_or_equal_to_sha
,
GraphQL
::
Types
::
String
,
as: :sha
,
required:
false
,
description:
'The SHA256 of the most recent acceptable version.'
...
...
app/graphql/resolvers/echo_resolver.rb
View file @
dad47460
...
...
@@ -2,11 +2,11 @@
module
Resolvers
class
EchoResolver
<
BaseResolver
type
::
GraphQL
::
STRING_TYPE
,
null:
false
type
::
GraphQL
::
Types
::
String
,
null:
false
description
'Testing endpoint to validate the API with'
argument
:text
,
type:
GraphQL
::
STRING_TYPE
,
type:
GraphQL
::
Types
::
String
,
required:
true
,
description:
'Text to echo back.'
...
...
app/graphql/resolvers/environments_resolver.rb
View file @
dad47460
...
...
@@ -2,15 +2,15 @@
module
Resolvers
class
EnvironmentsResolver
<
BaseResolver
argument
:name
,
GraphQL
::
STRING_TYPE
,
argument
:name
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Name of the environment.'
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Search query for environment name.'
argument
:states
,
[
GraphQL
::
STRING_TYPE
],
argument
:states
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'States of environments that should be included in result.'
...
...
app/graphql/resolvers/error_tracking/sentry_errors_resolver.rb
View file @
dad47460
...
...
@@ -6,12 +6,12 @@ module Resolvers
type
Types
::
ErrorTracking
::
SentryErrorType
.
connection_type
,
null:
true
extension
Gitlab
::
Graphql
::
Extensions
::
ExternallyPaginatedArrayExtension
argument
:search_term
,
::
GraphQL
::
STRING_TYPE
,
argument
:search_term
,
::
GraphQL
::
Types
::
String
,
description:
'Search query for the Sentry error details.'
,
required:
false
# TODO: convert to Enum
argument
:sort
,
::
GraphQL
::
STRING_TYPE
,
argument
:sort
,
::
GraphQL
::
Types
::
String
,
description:
'Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default.'
,
required:
false
...
...
app/graphql/resolvers/full_path_resolver.rb
View file @
dad47460
...
...
@@ -5,7 +5,7 @@ module Resolvers
extend
ActiveSupport
::
Concern
prepended
do
argument
:full_path
,
GraphQL
::
ID_TYPE
,
argument
:full_path
,
GraphQL
::
Types
::
ID
,
required:
true
,
description:
'The full path of the project, group or namespace, e.g., `gitlab-org/gitlab-foss`.'
end
...
...
app/graphql/resolvers/group_labels_resolver.rb
View file @
dad47460
...
...
@@ -4,12 +4,12 @@ module Resolvers
class
GroupLabelsResolver
<
LabelsResolver
type
Types
::
LabelType
.
connection_type
,
null:
true
argument
:include_descendant_groups
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_descendant_groups
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Include labels from descendant groups.'
,
default_value:
false
argument
:only_group_labels
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:only_group_labels
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Include only group level labels.'
,
default_value:
false
...
...
app/graphql/resolvers/group_milestones_resolver.rb
View file @
dad47460
...
...
@@ -2,10 +2,10 @@
module
Resolvers
class
GroupMilestonesResolver
<
MilestonesResolver
argument
:include_descendants
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_descendants
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Include milestones from all subgroups and subprojects.'
argument
:include_ancestors
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_ancestors
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Include milestones from all parent groups.'
...
...
app/graphql/resolvers/labels_resolver.rb
View file @
dad47460
...
...
@@ -8,11 +8,11 @@ module Resolvers
type
Types
::
LabelType
.
connection_type
,
null:
true
argument
:search_term
,
GraphQL
::
STRING_TYPE
,
argument
:search_term
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'A search term to find labels with.'
argument
:include_ancestor_groups
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_ancestor_groups
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Include labels from ancestor groups.'
,
default_value:
false
...
...
app/graphql/resolvers/members_resolver.rb
View file @
dad47460
...
...
@@ -7,7 +7,7 @@ module Resolvers
type
Types
::
MemberInterface
.
connection_type
,
null:
true
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Search query.'
...
...
app/graphql/resolvers/merge_request_resolver.rb
View file @
dad47460
...
...
@@ -8,7 +8,7 @@ module Resolvers
type
::
Types
::
MergeRequestType
,
null:
true
argument
:iid
,
GraphQL
::
STRING_TYPE
,
argument
:iid
,
GraphQL
::
Types
::
String
,
required:
true
,
as: :iids
,
description:
'IID of the merge request, for example `1`.'
...
...
app/graphql/resolvers/merge_requests_resolver.rb
View file @
dad47460
...
...
@@ -10,28 +10,28 @@ module Resolvers
alias_method
:project
,
:object
def
self
.
accept_assignee
argument
:assignee_username
,
GraphQL
::
STRING_TYPE
,
argument
:assignee_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of the assignee.'
end
def
self
.
accept_author
argument
:author_username
,
GraphQL
::
STRING_TYPE
,
argument
:author_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of the author.'
end
def
self
.
accept_reviewer
argument
:reviewer_username
,
GraphQL
::
STRING_TYPE
,
argument
:reviewer_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of the reviewer.'
end
argument
:iids
,
[
GraphQL
::
STRING_TYPE
],
argument
:iids
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Array of IIDs of merge requests, for example `[1, 2]`.'
argument
:source_branches
,
[
GraphQL
::
STRING_TYPE
],
argument
:source_branches
,
[
GraphQL
::
Types
::
String
],
required:
false
,
as: :source_branch
,
description:
<<~
DESC
...
...
@@ -39,7 +39,7 @@ module Resolvers
All resolved merge requests will have one of these branches as their source.
DESC
argument
:target_branches
,
[
GraphQL
::
STRING_TYPE
],
argument
:target_branches
,
[
GraphQL
::
Types
::
String
],
required:
false
,
as: :target_branch
,
description:
<<~
DESC
...
...
@@ -51,7 +51,7 @@ module Resolvers
required:
false
,
description:
'A merge request state. If provided, all resolved merge requests will have this state.'
argument
:labels
,
[
GraphQL
::
STRING_TYPE
],
argument
:labels
,
[
GraphQL
::
Types
::
String
],
required:
false
,
as: :label_name
,
description:
'Array of label names. All resolved merge requests will have all of these labels.'
...
...
@@ -61,7 +61,7 @@ module Resolvers
argument
:merged_before
,
Types
::
TimeType
,
required:
false
,
description:
'Merge requests merged before this date.'
argument
:milestone_title
,
GraphQL
::
STRING_TYPE
,
argument
:milestone_title
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Title of the milestone.'
argument
:sort
,
Types
::
MergeRequestSortEnum
,
...
...
@@ -70,11 +70,11 @@ module Resolvers
default_value: :created_desc
negated
do
argument
:labels
,
[
GraphQL
::
STRING_TYPE
],
argument
:labels
,
[
GraphQL
::
Types
::
String
],
required:
false
,
as: :label_name
,
description:
'Array of label names. All resolved merge requests will not have these labels.'
argument
:milestone_title
,
GraphQL
::
STRING_TYPE
,
argument
:milestone_title
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Title of the milestone.'
end
...
...
app/graphql/resolvers/metrics/dashboard_resolver.rb
View file @
dad47460
...
...
@@ -6,7 +6,7 @@ module Resolvers
type
Types
::
Metrics
::
DashboardType
,
null:
true
calls_gitaly!
argument
:path
,
GraphQL
::
STRING_TYPE
,
argument
:path
,
GraphQL
::
Types
::
String
,
required:
true
,
description:
<<~
MD
Path to a file which defines a metrics dashboard eg: `"config/prometheus/common_metrics.yml"`.
...
...
app/graphql/resolvers/milestones_resolver.rb
View file @
dad47460
...
...
@@ -5,7 +5,7 @@ module Resolvers
include
Gitlab
::
Graphql
::
Authorize
::
AuthorizeResource
include
TimeFrameArguments
argument
:ids
,
[
GraphQL
::
ID_TYPE
],
argument
:ids
,
[
GraphQL
::
Types
::
ID
],
required:
false
,
description:
'Array of global milestone IDs, e.g., `"gid://gitlab/Milestone/1"`.'
...
...
@@ -13,11 +13,11 @@ module Resolvers
required:
false
,
description:
'Filter milestones by state.'
argument
:title
,
GraphQL
::
STRING_TYPE
,
argument
:title
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'The title of the milestone.'
argument
:search_title
,
GraphQL
::
STRING_TYPE
,
argument
:search_title
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'A search string for the title.'
...
...
app/graphql/resolvers/namespace_projects_resolver.rb
View file @
dad47460
...
...
@@ -2,12 +2,12 @@
module
Resolvers
class
NamespaceProjectsResolver
<
BaseResolver
argument
:include_subgroups
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_subgroups
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
default_value:
false
,
description:
'Include also subgroup projects.'
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
default_value:
nil
,
description:
'Search project with most similar names or paths.'
...
...
@@ -17,7 +17,7 @@ module Resolvers
default_value:
nil
,
description:
'Sort projects by this criteria.'
argument
:ids
,
[
GraphQL
::
ID_TYPE
],
argument
:ids
,
[
GraphQL
::
Types
::
ID
],
required:
false
,
default_value:
nil
,
description:
'Filter projects by IDs.'
...
...
app/graphql/resolvers/packages_base_resolver.rb
View file @
dad47460
...
...
@@ -9,7 +9,7 @@ module Resolvers
required:
false
,
default_value: :created_desc
argument
:package_name
,
GraphQL
::
STRING_TYPE
,
argument
:package_name
,
GraphQL
::
Types
::
String
,
description:
'Search a package by name.'
,
required:
false
,
default_value:
nil
...
...
@@ -24,7 +24,7 @@ module Resolvers
required:
false
,
default_value:
nil
argument
:include_versionless
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_versionless
,
GraphQL
::
Types
::
Boolean
,
description:
'Include versionless packages.'
,
required:
false
,
default_value:
false
...
...
app/graphql/resolvers/project_milestones_resolver.rb
View file @
dad47460
...
...
@@ -3,7 +3,7 @@
module
Resolvers
class
ProjectMilestonesResolver
<
MilestonesResolver
argument
:include_ancestors
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:include_ancestors
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
"Also return milestones in the project's parent group and its ancestors."
...
...
app/graphql/resolvers/project_pipeline_resolver.rb
View file @
dad47460
...
...
@@ -6,11 +6,11 @@ module Resolvers
alias_method
:project
,
:object
argument
:iid
,
GraphQL
::
ID_TYPE
,
argument
:iid
,
GraphQL
::
Types
::
ID
,
required:
false
,
description:
'IID of the Pipeline. For example, "1".'
argument
:sha
,
GraphQL
::
STRING_TYPE
,
argument
:sha
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'SHA of the Pipeline. For example, "dyd0f15ay83993f5ab66k927w28673882x99100b".'
...
...
app/graphql/resolvers/projects/jira_projects_resolver.rb
View file @
dad47460
...
...
@@ -9,7 +9,7 @@ module Resolvers
authorize
:admin_project
argument
:name
,
GraphQL
::
STRING_TYPE
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Project name or key.'
...
...
app/graphql/resolvers/projects/services_resolver.rb
View file @
dad47460
...
...
@@ -10,7 +10,7 @@ module Resolvers
authorizes_object!
argument
:active
,
GraphQL
::
BOOLEAN_TYPE
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Indicates if the integration is active.'
argument
:type
,
...
...
app/graphql/resolvers/projects_resolver.rb
View file @
dad47460
...
...
@@ -4,27 +4,27 @@ module Resolvers
class
ProjectsResolver
<
BaseResolver
type
Types
::
ProjectType
,
null:
true
argument
:membership
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:membership
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Limit projects that the current user is a member of.'
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Search query for project name, path, or description.'
argument
:ids
,
[
GraphQL
::
ID_TYPE
],
argument
:ids
,
[
GraphQL
::
Types
::
ID
],
required:
false
,
description:
'Filter projects by IDs.'
argument
:search_namespaces
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:search_namespaces
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Include namespace in project search.'
argument
:sort
,
GraphQL
::
STRING_TYPE
,
argument
:sort
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Sort order of results.'
argument
:topics
,
type:
[
GraphQL
::
STRING_TYPE
],
argument
:topics
,
type:
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Filters projects by topics.'
...
...
app/graphql/resolvers/release_resolver.rb
View file @
dad47460
...
...
@@ -4,7 +4,7 @@ module Resolvers
class
ReleaseResolver
<
BaseResolver
type
Types
::
ReleaseType
,
null:
true
argument
:tag_name
,
GraphQL
::
STRING_TYPE
,
argument
:tag_name
,
GraphQL
::
Types
::
String
,
required:
true
,
description:
'The name of the tag associated to the release.'
...
...
app/graphql/resolvers/repository_branch_names_resolver.rb
View file @
dad47460
...
...
@@ -2,19 +2,19 @@
module
Resolvers
class
RepositoryBranchNamesResolver
<
BaseResolver
type
::
GraphQL
::
STRING_TYPE
,
null:
false
type
::
GraphQL
::
Types
::
String
,
null:
false
calls_gitaly!
argument
:search_pattern
,
GraphQL
::
STRING_TYPE
,
argument
:search_pattern
,
GraphQL
::
Types
::
String
,
required:
true
,
description:
'The pattern to search for branch names by.'
argument
:offset
,
GraphQL
::
INT_TYPE
,
argument
:offset
,
GraphQL
::
Types
::
Int
,
required:
true
,
description:
'The number of branch names to skip.'
argument
:limit
,
GraphQL
::
INT_TYPE
,
argument
:limit
,
GraphQL
::
Types
::
Int
,
required:
true
,
description:
'The number of branch names to return.'
...
...
app/graphql/resolvers/snippets/blobs_resolver.rb
View file @
dad47460
...
...
@@ -12,7 +12,7 @@ module Resolvers
alias_method
:snippet
,
:object
argument
:paths
,
[
GraphQL
::
STRING_TYPE
],
argument
:paths
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Paths of the blobs.'
...
...
app/graphql/resolvers/snippets_resolver.rb
View file @
dad47460
...
...
@@ -22,7 +22,7 @@ module Resolvers
description:
'The type of snippet.'
argument
:explore
,
GraphQL
::
BOOLEAN_TYPE
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
description:
'Explore personal snippets.'
...
...
app/graphql/resolvers/terraform/states_resolver.rb
View file @
dad47460
...
...
@@ -8,7 +8,7 @@ module Resolvers
alias_method
:project
,
:object
when_single
do
argument
:name
,
GraphQL
::
STRING_TYPE
,
argument
:name
,
GraphQL
::
Types
::
String
,
required:
true
,
description:
'Name of the Terraform state.'
end
...
...
app/graphql/resolvers/todo_resolver.rb
View file @
dad47460
...
...
@@ -10,15 +10,15 @@ module Resolvers
required:
false
,
description:
'The action to be filtered.'
argument
:author_id
,
[
GraphQL
::
ID_TYPE
],
argument
:author_id
,
[
GraphQL
::
Types
::
ID
],
required:
false
,
description:
'The ID of an author.'
argument
:project_id
,
[
GraphQL
::
ID_TYPE
],
argument
:project_id
,
[
GraphQL
::
Types
::
ID
],
required:
false
,
description:
'The ID of a project.'
argument
:group_id
,
[
GraphQL
::
ID_TYPE
],
argument
:group_id
,
[
GraphQL
::
Types
::
ID
],
required:
false
,
description:
'The ID of a group.'
...
...
app/graphql/resolvers/tree_resolver.rb
View file @
dad47460
...
...
@@ -6,15 +6,15 @@ module Resolvers
calls_gitaly!
argument
:path
,
GraphQL
::
STRING_TYPE
,
argument
:path
,
GraphQL
::
Types
::
String
,
required:
false
,
default_value:
''
,
description:
'The path to get the tree for. Default value is the root of the repository.'
argument
:ref
,
GraphQL
::
STRING_TYPE
,
argument
:ref
,
GraphQL
::
Types
::
String
,
required:
false
,
default_value: :head
,
description:
'The commit ref to get the tree for. Default value is HEAD.'
argument
:recursive
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:recursive
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
default_value:
false
,
description:
'Used to get a recursive tree. Default is false.'
...
...
app/graphql/resolvers/user_discussions_count_resolver.rb
View file @
dad47460
...
...
@@ -4,7 +4,7 @@ module Resolvers
class
UserDiscussionsCountResolver
<
BaseResolver
include
Gitlab
::
Graphql
::
Authorize
::
AuthorizeResource
type
GraphQL
::
INT_TYPE
,
null:
true
type
GraphQL
::
Types
::
Int
,
null:
true
def
resolve
authorize!
(
object
)
...
...
app/graphql/resolvers/user_merge_requests_resolver_base.rb
View file @
dad47460
...
...
@@ -5,7 +5,7 @@ module Resolvers
include
ResolvesProject
argument
:project_path
,
type:
GraphQL
::
STRING_TYPE
,
type:
GraphQL
::
Types
::
String
,
required:
false
,
description:
<<~
DESC
The full-path of the project the authored merge requests should be in.
...
...
app/graphql/resolvers/user_notes_count_resolver.rb
View file @
dad47460
...
...
@@ -4,7 +4,7 @@ module Resolvers
class
UserNotesCountResolver
<
BaseResolver
include
Gitlab
::
Graphql
::
Authorize
::
AuthorizeResource
type
GraphQL
::
INT_TYPE
,
null:
true
type
GraphQL
::
Types
::
Int
,
null:
true
def
resolve
authorize!
(
object
)
...
...
app/graphql/resolvers/user_resolver.rb
View file @
dad47460
...
...
@@ -10,7 +10,7 @@ module Resolvers
required:
false
,
description:
'ID of the User.'
argument
:username
,
GraphQL
::
STRING_TYPE
,
argument
:username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Username of the User.'
...
...
app/graphql/resolvers/user_starred_projects_resolver.rb
View file @
dad47460
...
...
@@ -4,7 +4,7 @@ module Resolvers
class
UserStarredProjectsResolver
<
BaseResolver
type
Types
::
ProjectType
.
connection_type
,
null:
true
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
'Search query.'
...
...
app/graphql/resolvers/users/group_count_resolver.rb
View file @
dad47460
...
...
@@ -3,7 +3,7 @@
module
Resolvers
module
Users
class
GroupCountResolver
<
BaseResolver
type
GraphQL
::
INT_TYPE
,
null:
true
type
GraphQL
::
Types
::
Int
,
null:
true
alias_method
:user
,
:object
...
...
app/graphql/resolvers/users_resolver.rb
View file @
dad47460
...
...
@@ -7,11 +7,11 @@ module Resolvers
type
Types
::
UserType
.
connection_type
,
null:
true
description
'Find Users'
argument
:ids
,
[
GraphQL
::
ID_TYPE
],
argument
:ids
,
[
GraphQL
::
Types
::
ID
],
required:
false
,
description:
'List of user Global IDs.'
argument
:usernames
,
[
GraphQL
::
STRING_TYPE
],
required:
false
,
argument
:usernames
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'List of usernames.'
argument
:sort
,
Types
::
SortEnum
,
...
...
@@ -19,11 +19,11 @@ module Resolvers
required:
false
,
default_value: :created_desc
argument
:search
,
GraphQL
::
STRING_TYPE
,
argument
:search
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
"Query to search users by name, username, or primary email."
argument
:admins
,
GraphQL
::
BOOLEAN_TYPE
,
argument
:admins
,
GraphQL
::
Types
::
Boolean
,
required:
false
,
default_value:
false
,
description:
'Return only admin users.'
...
...
ee/spec/graphql/resolvers/user_discussions_count_resolver_spec.rb
View file @
dad47460
...
...
@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserDiscussionsCountResolver do
let_it_be
(
:private_project
)
{
create
(
:project
,
:repository
,
:private
)
}
specify
do
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
INT_TYPE
)
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
Types
::
Int
)
end
context
'when counting discussions from an epic'
do
...
...
ee/spec/graphql/resolvers/user_notes_count_resolver_spec.rb
View file @
dad47460
...
...
@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserNotesCountResolver do
let_it_be
(
:private_project
)
{
create
(
:project
,
:repository
,
:private
)
}
specify
do
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
INT_TYPE
)
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
Types
::
Int
)
end
context
'when counting notes from an epic'
do
...
...
spec/graphql/resolvers/base_resolver_spec.rb
View file @
dad47460
...
...
@@ -7,8 +7,8 @@ RSpec.describe Resolvers::BaseResolver do
let
(
:resolver
)
do
Class
.
new
(
described_class
)
do
argument
:test
,
::
GraphQL
::
INT_TYPE
,
required:
false
type
[
::
GraphQL
::
INT_TYPE
],
null:
true
argument
:test
,
::
GraphQL
::
Types
::
Int
,
required:
false
type
[
::
GraphQL
::
Types
::
Int
],
null:
true
def
resolve
(
test:
100
)
process
(
object
)
...
...
@@ -22,7 +22,7 @@ RSpec.describe Resolvers::BaseResolver do
let
(
:last_resolver
)
do
Class
.
new
(
described_class
)
do
type
[
::
GraphQL
::
INT_TYPE
],
null:
true
type
[
::
GraphQL
::
Types
::
Int
],
null:
true
def
resolve
(
**
args
)
[
1
,
2
]
...
...
@@ -36,11 +36,11 @@ RSpec.describe Resolvers::BaseResolver do
context
'for a connection of scalars'
do
let
(
:resolver
)
do
Class
.
new
(
described_class
)
do
type
::
GraphQL
::
INT_TYPE
.
connection_type
,
null:
true
type
::
GraphQL
::
Types
::
Int
.
connection_type
,
null:
true
end
end
it
{
is_expected
.
to
eq
(
::
GraphQL
::
INT_TYPE
)
}
it
{
is_expected
.
to
eq
(
::
GraphQL
::
Types
::
Int
)
}
end
context
'for a connection of objects'
do
...
...
@@ -64,21 +64,21 @@ RSpec.describe Resolvers::BaseResolver do
context
'for a list type'
do
let
(
:resolver
)
do
Class
.
new
(
described_class
)
do
type
[
::
GraphQL
::
STRING_TYPE
],
null:
true
type
[
::
GraphQL
::
Types
::
String
],
null:
true
end
end
it
{
is_expected
.
to
eq
(
::
GraphQL
::
STRING_TYPE
)
}
it
{
is_expected
.
to
eq
(
::
GraphQL
::
Types
::
String
)
}
end
context
'for a scalar type'
do
let
(
:resolver
)
do
Class
.
new
(
described_class
)
do
type
::
GraphQL
::
BOOLEAN_TYPE
,
null:
true
type
::
GraphQL
::
Types
::
Boolean
,
null:
true
end
end
it
{
is_expected
.
to
eq
(
::
GraphQL
::
BOOLEAN_TYPE
)
}
it
{
is_expected
.
to
eq
(
::
GraphQL
::
Types
::
Boolean
)
}
end
end
...
...
@@ -88,7 +88,7 @@ RSpec.describe Resolvers::BaseResolver do
end
it
'has the correct (singular) type'
do
expect
(
resolver
.
single
.
type
).
to
eq
(
::
GraphQL
::
INT_TYPE
)
expect
(
resolver
.
single
.
type
).
to
eq
(
::
GraphQL
::
Types
::
Int
)
end
it
'returns the same subclass every time'
do
...
...
@@ -105,10 +105,10 @@ RSpec.describe Resolvers::BaseResolver do
describe
'.when_single'
do
let
(
:resolver
)
do
Class
.
new
(
described_class
)
do
type
[
::
GraphQL
::
INT_TYPE
],
null:
true
type
[
::
GraphQL
::
Types
::
Int
],
null:
true
when_single
do
argument
:foo
,
::
GraphQL
::
INT_TYPE
,
required:
true
argument
:foo
,
::
GraphQL
::
Types
::
Int
,
required:
true
end
def
resolve
(
foo:
1
)
...
...
@@ -138,14 +138,14 @@ RSpec.describe Resolvers::BaseResolver do
context
'multiple when_single blocks'
do
let
(
:resolver
)
do
Class
.
new
(
described_class
)
do
type
[
::
GraphQL
::
INT_TYPE
],
null:
true
type
[
::
GraphQL
::
Types
::
Int
],
null:
true
when_single
do
argument
:foo
,
::
GraphQL
::
INT_TYPE
,
required:
true
argument
:foo
,
::
GraphQL
::
Types
::
Int
,
required:
true
end
when_single
do
argument
:bar
,
::
GraphQL
::
INT_TYPE
,
required:
true
argument
:bar
,
::
GraphQL
::
Types
::
Int
,
required:
true
end
def
resolve
(
foo:
1
,
bar:
2
)
...
...
@@ -168,7 +168,7 @@ RSpec.describe Resolvers::BaseResolver do
let
(
:subclass
)
do
Class
.
new
(
resolver
)
do
when_single
do
argument
:inc
,
::
GraphQL
::
INT_TYPE
,
required:
true
argument
:inc
,
::
GraphQL
::
Types
::
Int
,
required:
true
end
def
resolve
(
foo
:,
inc
:)
...
...
@@ -194,7 +194,7 @@ RSpec.describe Resolvers::BaseResolver do
context
'when the resolver returns early'
do
let
(
:resolver
)
do
Class
.
new
(
described_class
)
do
type
[
::
GraphQL
::
STRING_TYPE
],
null:
true
type
[
::
GraphQL
::
Types
::
String
],
null:
true
def
ready?
(
**
args
)
[
false
,
%w[early return]
]
...
...
@@ -237,14 +237,14 @@ RSpec.describe Resolvers::BaseResolver do
context
'when field is a connection'
do
it
'increases complexity based on arguments'
do
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
STRING_TYPE
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
1
)
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
Types
::
String
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
1
)
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{
sort:
'foo'
},
1
)).
to
eq
3
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{
search:
'foo'
},
1
)).
to
eq
7
end
it
'does not increase complexity when filtering by iids'
do
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
STRING_TYPE
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
Types
::
String
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{
sort:
'foo'
},
1
)).
to
eq
6
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{
sort:
'foo'
,
iid:
1
},
1
)).
to
eq
3
...
...
spec/graphql/resolvers/concerns/caching_array_resolver_spec.rb
View file @
dad47460
...
...
@@ -20,7 +20,7 @@ RSpec.describe ::CachingArrayResolver do
Class
.
new
(
::
Resolvers
::
BaseResolver
)
do
include
mod
type
[
::
Types
::
UserType
],
null:
true
argument
:is_admin
,
::
GraphQL
::
BOOLEAN_TYPE
,
required:
false
argument
:is_admin
,
::
GraphQL
::
Types
::
Boolean
,
required:
false
def
query_input
(
is_admin
:)
is_admin
...
...
@@ -50,7 +50,7 @@ RSpec.describe ::CachingArrayResolver do
Class
.
new
(
::
Resolvers
::
BaseResolver
)
do
include
mod
type
[
::
Types
::
UserType
],
null:
true
argument
:username
,
::
GraphQL
::
STRING_TYPE
,
required:
false
argument
:username
,
::
GraphQL
::
Types
::
String
,
required:
false
def
query_input
(
username
:)
username
...
...
spec/graphql/resolvers/concerns/resolves_pipelines_spec.rb
View file @
dad47460
...
...
@@ -50,7 +50,7 @@ RSpec.describe ResolvesPipelines do
end
it
'increases field complexity based on arguments'
do
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
STRING_TYPE
,
resolver_class:
resolver
,
null:
false
,
max_page_size:
1
)
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
Types
::
String
,
resolver_class:
resolver
,
null:
false
,
max_page_size:
1
)
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{},
1
)).
to
eq
2
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{
sha:
'foo'
},
1
)).
to
eq
4
...
...
spec/graphql/resolvers/echo_resolver_spec.rb
View file @
dad47460
...
...
@@ -9,7 +9,7 @@ RSpec.describe Resolvers::EchoResolver do
let
(
:text
)
{
'Message test'
}
specify
do
expect
(
described_class
).
to
have_non_null_graphql_type
(
::
GraphQL
::
STRING_TYPE
)
expect
(
described_class
).
to
have_non_null_graphql_type
(
::
GraphQL
::
Types
::
String
)
end
describe
'#resolve'
do
...
...
spec/graphql/resolvers/issues_resolver_spec.rb
View file @
dad47460
...
...
@@ -407,7 +407,7 @@ RSpec.describe Resolvers::IssuesResolver do
end
it
'increases field complexity based on arguments'
do
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
STRING_TYPE
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
Types
::
String
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{},
1
)).
to
eq
4
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{
labelName:
'foo'
},
1
)).
to
eq
8
...
...
spec/graphql/resolvers/namespace_projects_resolver_spec.rb
View file @
dad47460
...
...
@@ -145,7 +145,7 @@ RSpec.describe Resolvers::NamespaceProjectsResolver do
end
it
'has an high complexity regardless of arguments'
do
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
STRING_TYPE
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
field
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
Types
::
String
.
connection_type
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{},
1
)).
to
eq
24
expect
(
field
.
to_graphql
.
complexity
.
call
({},
{
include_subgroups:
true
},
1
)).
to
eq
24
...
...
spec/graphql/resolvers/project_resolver_spec.rb
View file @
dad47460
...
...
@@ -28,8 +28,8 @@ RSpec.describe Resolvers::ProjectResolver do
end
it
'does not increase complexity depending on number of load limits'
do
field1
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
STRING_TYPE
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
field2
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
STRING_TYPE
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
1
)
field1
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
Types
::
String
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
100
)
field2
=
Types
::
BaseField
.
new
(
name:
'test'
,
type:
GraphQL
::
Types
::
String
,
resolver_class:
described_class
,
null:
false
,
max_page_size:
1
)
expect
(
field1
.
to_graphql
.
complexity
.
call
({},
{},
1
)).
to
eq
2
expect
(
field2
.
to_graphql
.
complexity
.
call
({},
{},
1
)).
to
eq
2
...
...
spec/graphql/resolvers/terraform/states_resolver_spec.rb
View file @
dad47460
...
...
@@ -43,7 +43,8 @@ RSpec.describe Resolvers::Terraform::StatesResolver.single do
it
do
expect
(
subject
).
to
be_present
expect
(
subject
.
type
.
to_s
).
to
eq
(
'String!'
)
expect
(
subject
.
type
).
to
be_kind_of
GraphQL
::
Schema
::
NonNull
expect
(
subject
.
type
.
unwrap
).
to
eq
GraphQL
::
Types
::
String
expect
(
subject
.
description
).
to
be_present
end
end
...
...
spec/graphql/resolvers/user_discussions_count_resolver_spec.rb
View file @
dad47460
...
...
@@ -16,7 +16,7 @@ RSpec.describe Resolvers::UserDiscussionsCountResolver do
let_it_be
(
:private_discussion
)
{
create_list
(
:discussion_note_on_issue
,
3
,
noteable:
private_issue
,
project:
private_project
)
}
specify
do
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
INT_TYPE
)
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
Types
::
Int
)
end
context
'when counting discussions from a public issue'
do
...
...
spec/graphql/resolvers/user_notes_count_resolver_spec.rb
View file @
dad47460
...
...
@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserNotesCountResolver do
let_it_be
(
:private_project
)
{
create
(
:project
,
:repository
,
:private
)
}
specify
do
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
INT_TYPE
)
expect
(
described_class
).
to
have_nullable_graphql_type
(
GraphQL
::
Types
::
Int
)
end
context
'when counting notes from an issue'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment