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
d31c908b
Commit
d31c908b
authored
Sep 25, 2019
by
Arun Kumar Mohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `conditionally_graphql!` to `run_graphql!`
And remove the unnecessary `fallback` parameter
parent
80713292
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
lib/api/helpers/graphql_helpers.rb
lib/api/helpers/graphql_helpers.rb
+1
-1
lib/api/version.rb
lib/api/version.rb
+2
-3
No files found.
lib/api/helpers/graphql_helpers.rb
View file @
d31c908b
...
...
@@ -6,7 +6,7 @@ module API
# against the graphql API. Helper code for the graphql server implementation
# should be in app/graphql/ or lib/gitlab/graphql/
module
GraphqlHelpers
def
conditionally_graphql!
(
fallback
:,
query
:,
context:
{},
transform:
nil
)
def
run_graphql!
(
query
:,
context:
{},
transform:
nil
)
result
=
GitlabSchema
.
execute
(
query
,
context:
context
)
if
transform
...
...
lib/api/version.rb
View file @
d31c908b
...
...
@@ -19,11 +19,10 @@ module API
detail
'This feature was introduced in GitLab 8.13.'
end
get
'/version'
do
conditionally
_graphql!
(
run
_graphql!
(
query:
METADATA_QUERY
,
context:
{
current_user:
current_user
},
transform:
->
(
result
)
{
result
.
dig
(
'data'
,
'metadata'
)
},
fallback:
->
{
{
version:
Gitlab
::
VERSION
,
revision:
Gitlab
.
revision
}
}
transform:
->
(
result
)
{
result
.
dig
(
'data'
,
'metadata'
)
}
)
end
end
...
...
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