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
b2c60b1a
Commit
b2c60b1a
authored
Apr 01, 2022
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unresolved name due to cyclic definition
This problem is seen with 1.13.11 of the graphql gem
parent
29c6a47c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
.rubocop.yml
.rubocop.yml
+1
-0
app/graphql/resolvers/base_issues_resolver.rb
app/graphql/resolvers/base_issues_resolver.rb
+2
-1
app/graphql/types/issue_connection.rb
app/graphql/types/issue_connection.rb
+15
-0
No files found.
.rubocop.yml
View file @
b2c60b1a
...
...
@@ -135,6 +135,7 @@ Naming/FileName:
-
'
qa/qa/specs/**/*'
-
'
qa/tasks/**/*.rake'
-
'
**/*.ru'
-
'
app/graphql/types/issue_connection.rb'
IgnoreExecutableScripts
:
true
AllowedAcronyms
:
...
...
app/graphql/resolvers/base_issues_resolver.rb
View file @
b2c60b1a
...
...
@@ -12,7 +12,8 @@ module Resolvers
required:
false
,
description:
'Current state of this issue.'
type
Types
::
IssueType
.
connection_type
,
null:
true
# see app/graphql/types/issue_connection.rb
type
'Types::IssueConnection'
,
null:
true
NON_STABLE_CURSOR_SORTS
=
%i[priority_asc priority_desc
popularity_asc popularity_desc
...
...
app/graphql/types/issue_connection.rb
0 → 100644
View file @
b2c60b1a
# frozen_string_literal: true
# Normally this wouldn't be needed and we could use
# type Types::IssueType.connection_type, null: true
# in a resolver. However we can end up with cyclic definitions,
# which can result in errors like
# NameError: uninitialized constant Resolvers::GroupIssuesResolver
#
# Now we would use
# type "Types::IssueConnection", null: true
# which gives a delayed resolution, and the proper connection type.
# See app/graphql/resolvers/base_issues_resolver.rb
# Reference: https://github.com/rmosolgo/graphql-ruby/issues/3974#issuecomment-1084444214
Types
::
IssueConnection
=
Types
::
IssueType
.
connection_type
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