Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
175
Issues
175
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
872564e3
Commit
872564e3
authored
Nov 04, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql] userinfo mutation work
parent
f4396192
Pipeline
#2040
failed with stage
in 10 minutes and 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
GraphQL.hs
src/Gargantext/API/GraphQL.hs
+1
-1
UserInfo.hs
src/Gargantext/API/GraphQL/UserInfo.hs
+6
-2
No files found.
src/Gargantext/API/GraphQL.hs
View file @
872564e3
...
@@ -82,7 +82,7 @@ data Query m
...
@@ -82,7 +82,7 @@ data Query m
data
Mutation
m
data
Mutation
m
=
Mutation
=
Mutation
{
update_user_info
::
GQLUserInfo
.
UserInfoMArgs
->
m
GQLUserInfo
.
UserInfo
}
{
update_user_info
::
GQLUserInfo
.
UserInfoMArgs
->
m
Int
}
deriving
(
Generic
,
GQLType
)
deriving
(
Generic
,
GQLType
)
-- | Possible GraphQL Events, i.e. here we describe how we will
-- | Possible GraphQL Events, i.e. here we describe how we will
...
...
src/Gargantext/API/GraphQL/UserInfo.hs
View file @
872564e3
...
@@ -36,7 +36,9 @@ import Gargantext.Database.Admin.Types.Hyperdata.Contact
...
@@ -36,7 +36,9 @@ import Gargantext.Database.Admin.Types.Hyperdata.Contact
,
ct_phone
,
ct_phone
,
hc_who
,
hc_who
,
hc_where
)
,
hc_where
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
))
import
Gargantext.Database.Prelude
(
HasConnectionPool
,
HasConfig
)
import
Gargantext.Database.Prelude
(
HasConnectionPool
,
HasConfig
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Query.Table.User
(
getUsersWithHyperdata
)
import
Gargantext.Database.Query.Table.User
(
getUsersWithHyperdata
)
import
Gargantext.Database.Schema.User
(
UserLight
(
..
))
import
Gargantext.Database.Schema.User
(
UserLight
(
..
))
import
Gargantext.Prelude
import
Gargantext.Prelude
...
@@ -97,7 +99,7 @@ resolveUserInfos UserInfoArgs { user_id } = dbUsers user_id
...
@@ -97,7 +99,7 @@ resolveUserInfos UserInfoArgs { user_id } = dbUsers user_id
-- | Mutation for user info
-- | Mutation for user info
updateUserInfo
updateUserInfo
::
(
HasConnectionPool
env
,
HasConfig
env
)
::
(
HasConnectionPool
env
,
HasConfig
env
)
=>
UserInfoMArgs
->
ResolverM
e
(
GargM
env
GargError
)
UserInfo
=>
UserInfoMArgs
->
ResolverM
e
(
GargM
env
GargError
)
Int
updateUserInfo
(
UserInfoMArgs
{
ui_id
,
..
})
=
do
updateUserInfo
(
UserInfoMArgs
{
ui_id
,
..
})
=
do
lift
$
printDebug
"[updateUserInfo] ui_id"
ui_id
lift
$
printDebug
"[updateUserInfo] ui_id"
ui_id
users
<-
lift
(
getUsersWithHyperdata
ui_id
)
users
<-
lift
(
getUsersWithHyperdata
ui_id
)
...
@@ -119,7 +121,9 @@ updateUserInfo (UserInfoMArgs { ui_id, .. }) = do
...
@@ -119,7 +121,9 @@ updateUserInfo (UserInfoMArgs { ui_id, .. }) = do
uh
ui_cwTouchPhoneL
ui_cwTouchPhone
$
uh
ui_cwTouchPhoneL
ui_cwTouchPhone
$
u_hyperdata
u_hyperdata
lift
$
printDebug
"[updateUserInfo] with firstName"
u_hyperdata'
lift
$
printDebug
"[updateUserInfo] with firstName"
u_hyperdata'
pure
$
toUser
(
u
,
u_hyperdata'
)
_
<-
lift
$
updateHyperdata
(
NodeId
ui_id
)
u_hyperdata'
--let _newUser = toUser (u, u_hyperdata')
pure
1
where
where
uh
_
Nothing
u_hyperdata
=
u_hyperdata
uh
_
Nothing
u_hyperdata
=
u_hyperdata
uh
lens'
(
Just
val
)
u_hyperdata
=
u_hyperdata
&
lens'
.~
Just
val
uh
lens'
(
Just
val
)
u_hyperdata
=
u_hyperdata
&
lens'
.~
Just
val
...
...
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