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
640eb291
Commit
640eb291
authored
Dec 13, 2021
by
Mario Celi
Committed by
Natalia Tepluhina
Dec 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed local GraphQL Work Item types
parent
1d211d12
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
54 additions
and
55 deletions
+54
-55
app/assets/javascripts/work_items/graphql/create_work_item.mutation.graphql
...ipts/work_items/graphql/create_work_item.mutation.graphql
+3
-3
app/assets/javascripts/work_items/graphql/fragmentTypes.json
app/assets/javascripts/work_items/graphql/fragmentTypes.json
+1
-1
app/assets/javascripts/work_items/graphql/provider.js
app/assets/javascripts/work_items/graphql/provider.js
+3
-3
app/assets/javascripts/work_items/graphql/resolvers.js
app/assets/javascripts/work_items/graphql/resolvers.js
+10
-10
app/assets/javascripts/work_items/graphql/typedefs.graphql
app/assets/javascripts/work_items/graphql/typedefs.graphql
+23
-23
app/assets/javascripts/work_items/graphql/update_work_item.mutation.graphql
...ipts/work_items/graphql/update_work_item.mutation.graphql
+3
-3
app/assets/javascripts/work_items/graphql/widget.fragment.graphql
...ts/javascripts/work_items/graphql/widget.fragment.graphql
+1
-1
app/assets/javascripts/work_items/graphql/work_item.query.graphql
...ts/javascripts/work_items/graphql/work_item.query.graphql
+1
-1
app/assets/javascripts/work_items/pages/create_work_item.vue
app/assets/javascripts/work_items/pages/create_work_item.vue
+2
-3
spec/frontend/work_items/mock_data.js
spec/frontend/work_items/mock_data.js
+7
-7
No files found.
app/assets/javascripts/work_items/graphql/create_work_item.mutation.graphql
View file @
640eb291
#import './widget.fragment.graphql'
mutation
createWorkItem
(
$input
:
CreateWorkItemInput
)
{
c
reateWorkItem
(
input
:
$input
)
@client
{
mutation
createWorkItem
(
$input
:
Local
CreateWorkItemInput
)
{
localC
reateWorkItem
(
input
:
$input
)
@client
{
workItem
{
id
type
widgets
{
nodes
{
...
WidgetBase
...
on
TitleWidget
{
...
on
Local
TitleWidget
{
contentText
}
}
...
...
app/assets/javascripts/work_items/graphql/fragmentTypes.json
View file @
640eb291
{
"__schema"
:{
"types"
:[{
"kind"
:
"INTERFACE"
,
"name"
:
"
WorkItemWidget"
,
"possibleTypes"
:[{
"name"
:
"
TitleWidget"
}]}]}}
{
"__schema"
:{
"types"
:[{
"kind"
:
"INTERFACE"
,
"name"
:
"
LocalWorkItemWidget"
,
"possibleTypes"
:[{
"name"
:
"Local
TitleWidget"
}]}]}}
app/assets/javascripts/work_items/graphql/provider.js
View file @
640eb291
...
...
@@ -28,14 +28,14 @@ export function createApolloProvider() {
},
data
:
{
workItem
:
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
id
:
'
1
'
,
type
:
'
FEATURE
'
,
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
// eslint-disable-next-line @gitlab/require-i18n-strings
...
...
app/assets/javascripts/work_items/graphql/resolvers.js
View file @
640eb291
...
...
@@ -3,17 +3,17 @@ import workItemQuery from './work_item.query.graphql';
export
const
resolvers
=
{
Mutation
:
{
c
reateWorkItem
(
_
,
{
input
},
{
cache
})
{
localC
reateWorkItem
(
_
,
{
input
},
{
cache
})
{
const
id
=
uuids
()[
0
];
const
workItem
=
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
type
:
'
FEATURE
'
,
id
,
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
contentText
:
input
.
title
,
...
...
@@ -25,24 +25,24 @@ export const resolvers = {
cache
.
writeQuery
({
query
:
workItemQuery
,
variables
:
{
id
},
data
:
{
workItem
}
});
return
{
__typename
:
'
CreateWorkItemPayload
'
,
__typename
:
'
Local
CreateWorkItemPayload
'
,
workItem
,
};
},
u
pdateWorkItem
(
_
,
{
input
},
{
cache
})
{
localU
pdateWorkItem
(
_
,
{
input
},
{
cache
})
{
const
workItemTitle
=
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
contentText
:
input
.
title
,
};
const
workItem
=
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
type
:
'
FEATURE
'
,
id
:
input
.
id
,
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
workItemTitle
],
},
};
...
...
@@ -50,7 +50,7 @@ export const resolvers = {
cache
.
writeQuery
({
query
:
workItemQuery
,
variables
:
{
id
:
input
.
id
},
data
:
{
workItem
}
});
return
{
__typename
:
'
UpdateWorkItemPayload
'
,
__typename
:
'
Local
UpdateWorkItemPayload
'
,
workItem
,
};
},
...
...
app/assets/javascripts/work_items/graphql/typedefs.graphql
View file @
640eb291
enum
WorkItemType
{
enum
Local
WorkItemType
{
FEATURE
}
enum
WidgetType
{
enum
Local
WidgetType
{
TITLE
}
interface
WorkItemWidget
{
type
:
WidgetType
!
interface
Local
WorkItemWidget
{
type
:
Local
WidgetType
!
}
# Replicating Relay connection type for client schema
type
WorkItemWidgetEdge
{
type
Local
WorkItemWidgetEdge
{
cursor
:
String
!
node
:
WorkItemWidget
node
:
Local
WorkItemWidget
}
type
WorkItemWidgetConnection
{
edges
:
[
WorkItemWidgetEdge
]
nodes
:
[
WorkItemWidget
]
type
Local
WorkItemWidgetConnection
{
edges
:
[
Local
WorkItemWidgetEdge
]
nodes
:
[
Local
WorkItemWidget
]
pageInfo
:
PageInfo
!
}
type
TitleWidget
implements
WorkItemWidget
{
type
:
WidgetType
!
type
LocalTitleWidget
implements
Local
WorkItemWidget
{
type
:
Local
WidgetType
!
contentText
:
String
!
}
type
WorkItem
{
type
Local
WorkItem
{
id
:
ID
!
type
:
WorkItemType
!
widgets
:
[
WorkItemWidgetConnection
]
type
:
Local
WorkItemType
!
widgets
:
[
Local
WorkItemWidgetConnection
]
}
type
CreateWorkItemInput
{
type
Local
CreateWorkItemInput
{
title
:
String
!
}
type
UpdateWorkItemInput
{
type
Local
UpdateWorkItemInput
{
id
:
ID
!
title
:
String
}
type
CreateWorkItemPayload
{
workItem
:
WorkItem
!
type
Local
CreateWorkItemPayload
{
workItem
:
Local
WorkItem
!
}
type
UpdateWorkItemPayload
{
workItem
:
WorkItem
!
type
Local
UpdateWorkItemPayload
{
workItem
:
Local
WorkItem
!
}
extend
type
Query
{
workItem
(
id
:
ID
!):
WorkItem
!
workItem
(
id
:
ID
!):
Local
WorkItem
!
}
extend
type
Mutation
{
createWorkItem
(
input
:
CreateWorkItemInput
!):
CreateWorkItemPayload
!
updateWorkItem
(
input
:
UpdateWorkItemInput
!):
UpdateWorkItemPayload
!
localCreateWorkItem
(
input
:
LocalCreateWorkItemInput
!):
Local
CreateWorkItemPayload
!
localUpdateWorkItem
(
input
:
LocalUpdateWorkItemInput
!):
Local
UpdateWorkItemPayload
!
}
app/assets/javascripts/work_items/graphql/update_work_item.mutation.graphql
View file @
640eb291
#import './widget.fragment.graphql'
mutation
updateWorkItem
(
$input
:
UpdateWorkItemInput
)
{
u
pdateWorkItem
(
input
:
$input
)
@client
{
mutation
updateWorkItem
(
$input
:
Local
UpdateWorkItemInput
)
{
localU
pdateWorkItem
(
input
:
$input
)
@client
{
workItem
{
id
type
widgets
{
nodes
{
...
WidgetBase
...
on
TitleWidget
{
...
on
Local
TitleWidget
{
contentText
}
}
...
...
app/assets/javascripts/work_items/graphql/widget.fragment.graphql
View file @
640eb291
fragment
WidgetBase
on
WorkItemWidget
{
fragment
WidgetBase
on
Local
WorkItemWidget
{
type
}
app/assets/javascripts/work_items/graphql/work_item.query.graphql
View file @
640eb291
...
...
@@ -7,7 +7,7 @@ query WorkItem($id: ID!) {
widgets
{
nodes
{
...
WidgetBase
...
on
TitleWidget
{
...
on
Local
TitleWidget
{
contentText
}
}
...
...
app/assets/javascripts/work_items/pages/create_work_item.vue
View file @
640eb291
...
...
@@ -30,7 +30,7 @@ export default {
const
{
data
:
{
c
reateWorkItem
:
{
localC
reateWorkItem
:
{
workItem
:
{
id
},
},
},
...
...
@@ -60,11 +60,10 @@ export default {
class=
"gl-mr-3"
data-testid=
"create-button"
type=
"submit"
@
click=
"createWorkItem"
>
{{
__
(
'
Create
'
)
}}
</gl-button>
<gl-button
data-testid=
"cancel-button"
@
click=
"$router.go(-1)"
>
<gl-button
type=
"button"
data-testid=
"cancel-button"
@
click=
"$router.go(-1)"
>
{{
__
(
'
Cancel
'
)
}}
</gl-button>
</div>
...
...
spec/frontend/work_items/mock_data.js
View file @
640eb291
export
const
workItemQueryResponse
=
{
workItem
:
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
id
:
'
1
'
,
type
:
'
FEATURE
'
,
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
contentText
:
'
Test
'
,
},
...
...
@@ -17,15 +17,15 @@ export const workItemQueryResponse = {
};
export
const
updateWorkItemMutationResponse
=
{
__typename
:
'
UpdateWorkItemPayload
'
,
__typename
:
'
Local
UpdateWorkItemPayload
'
,
workItem
:
{
__typename
:
'
WorkItem
'
,
__typename
:
'
Local
WorkItem
'
,
id
:
'
1
'
,
widgets
:
{
__typename
:
'
WorkItemWidgetConnection
'
,
__typename
:
'
Local
WorkItemWidgetConnection
'
,
nodes
:
[
{
__typename
:
'
TitleWidget
'
,
__typename
:
'
Local
TitleWidget
'
,
type
:
'
TITLE
'
,
enabled
:
true
,
contentText
:
'
Updated title
'
,
...
...
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