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
805589b4
Commit
805589b4
authored
May 14, 2020
by
Enrique Alcantara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review feedback
Enclose mutation parameters in an input data type
parent
a47e21ab
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
18 deletions
+29
-18
app/assets/javascripts/static_site_editor/graphql/mutations/submit_content_changes.mutation.graphql
...graphql/mutations/submit_content_changes.mutation.graphql
+2
-2
app/assets/javascripts/static_site_editor/graphql/resolvers/submit_content_changes.js
...c_site_editor/graphql/resolvers/submit_content_changes.js
+2
-2
app/assets/javascripts/static_site_editor/graphql/typedefs.graphql
...s/javascripts/static_site_editor/graphql/typedefs.graphql
+12
-5
app/assets/javascripts/static_site_editor/pages/home.vue
app/assets/javascripts/static_site_editor/pages/home.vue
+6
-4
spec/frontend/static_site_editor/graphql/resolvers/submit_content_changes_spec.js
...e_editor/graphql/resolvers/submit_content_changes_spec.js
+1
-1
spec/frontend/static_site_editor/pages/home_spec.js
spec/frontend/static_site_editor/pages/home_spec.js
+6
-4
No files found.
app/assets/javascripts/static_site_editor/graphql/mutations/submit_content_changes.mutation.graphql
View file @
805589b4
mutation
submitContentChanges
(
$
project
:
ID
!,
$username
:
String
!,
$sourcePath
:
String
!,
$content
:
String
!
)
{
submitContentChanges
(
project
:
$project
,
username
:
$username
,
sourcePath
:
$sourcePath
,
content
:
$conten
t
)
@client
{
mutation
submitContentChanges
(
$
input
:
SubmitContentChangesInput
)
{
submitContentChanges
(
input
:
$inpu
t
)
@client
{
branch
commit
mergeRequest
...
...
app/assets/javascripts/static_site_editor/graphql/resolvers/submit_content_changes.js
View file @
805589b4
...
...
@@ -2,8 +2,8 @@ import submitContentChanges from '../../services/submit_content_changes';
import
savedContentMetaQuery
from
'
../queries/saved_content_meta.query.graphql
'
;
const
submitContentChangesResolver
=
(
_
root
,
{
project
:
projectId
,
username
,
sourcePath
,
content
},
_
,
{
input
:
{
project
:
projectId
,
username
,
sourcePath
,
content
}
},
{
cache
},
)
=>
{
return
submitContentChanges
({
projectId
,
username
,
sourcePath
,
content
}).
then
(
...
...
app/assets/javascripts/static_site_editor/graphql/typedefs.graphql
View file @
805589b4
...
...
@@ -14,10 +14,6 @@ type SavedContentMeta {
branch
:
SavedContentField
!
}
extend
type
Project
{
file
(
path
:
ID
!):
File
}
type
AppData
{
isSupportedContent
:
Boolean
!
project
:
String
!
...
...
@@ -26,11 +22,22 @@ type AppData {
username
:
String
!
}
type
SubmitContentChangesInput
{
project
:
String
!
sourcePath
:
String
!
content
:
String
!
username
:
String
!
}
extend
type
Project
{
file
(
path
:
ID
!):
File
}
extend
type
Query
{
appData
:
AppData
!
savedContentMeta
:
SavedContentMeta
}
extend
type
Mutation
{
submitContentChanges
(
project
:
String
!,
sourcePath
:
String
!,
content
:
String
!,
username
:
String
!):
SavedContentMeta
submitContentChanges
(
input
:
SubmitContentChangesInput
!):
SavedContentMeta
}
app/assets/javascripts/static_site_editor/pages/home.vue
View file @
805589b4
...
...
@@ -74,10 +74,12 @@ export default {
.
mutate
({
mutation
:
submitContentChangesMutation
,
variables
:
{
project
:
this
.
appData
.
project
,
username
:
this
.
appData
.
username
,
sourcePath
:
this
.
appData
.
sourcePath
,
content
:
this
.
content
,
input
:
{
project
:
this
.
appData
.
project
,
username
:
this
.
appData
.
username
,
sourcePath
:
this
.
appData
.
sourcePath
,
content
:
this
.
content
,
},
},
})
.
then
(()
=>
{
...
...
spec/frontend/static_site_editor/graphql/resolvers/submit_content_changes_spec.js
View file @
805589b4
...
...
@@ -20,7 +20,7 @@ describe('static_site_editor/graphql/resolvers/submit_content_changes', () => {
return
submitContentChangesResolver
(
{},
{
path
:
sourcePath
,
project
,
sourcePath
,
content
,
username
},
{
input
:
{
path
:
sourcePath
,
project
,
sourcePath
,
content
,
username
}
},
{
cache
},
).
then
(()
=>
{
expect
(
cache
.
writeQuery
).
toHaveBeenCalledWith
({
...
...
spec/frontend/static_site_editor/pages/home_spec.js
View file @
805589b4
...
...
@@ -194,10 +194,12 @@ describe('static_site_editor/pages/home', () => {
expect
(
mutateMock
).
toHaveBeenCalledWith
({
mutation
:
submitContentChangesMutation
,
variables
:
{
content
:
newContent
,
project
,
sourcePath
,
username
,
input
:
{
content
:
newContent
,
project
,
sourcePath
,
username
,
},
},
});
});
...
...
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