Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
purescript-gargantext
Commits
984e2035
Commit
984e2035
authored
Oct 28, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql] deriving field query experiments
parent
af455fde
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
12 deletions
+73
-12
packages.dhall
packages.dhall
+53
-0
User.purs
src/Gargantext/Components/GraphQL/User.purs
+7
-1
User.purs
src/Gargantext/Components/Nodes/Annuaire/User.purs
+13
-11
No files found.
packages.dhall
View file @
984e2035
...
...
@@ -7,6 +7,59 @@ let overrides =
, repo = "https://github.com/purescript/purescript-globals"
, version = "v4.1.0"
}
, graphql-client =
{ dependencies =
[ "aff"
, "aff-promise"
, "affjax"
, "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "bifunctors"
, "control"
, "datetime"
, "debug"
, "effect"
, "either"
, "enums"
, "exceptions"
, "foldable-traversable"
, "foreign"
, "foreign-generic"
, "foreign-object"
, "functions"
, "halogen-subscriptions"
, "heterogeneous"
, "http-methods"
, "integers"
, "lists"
, "maybe"
, "media-types"
, "newtype"
, "node-buffer"
, "node-fs"
, "nullable"
, "numbers"
, "ordered-collections"
, "parsing"
, "prelude"
, "profunctor"
, "profunctor-lenses"
, "psci-support"
, "quickcheck"
, "record"
, "spec"
, "spec-discovery"
, "string-parsers"
, "strings"
, "strings-extra"
, "transformers"
, "tuples"
, "unicode"
]
, repo = "https://github.com/OxfordAbstracts/purescript-graphql-client"
, version = "34df2d4eaf3be5d66fb6f48963be5b2e715ab290"
}
, smolder =
{ dependencies =
[ "bifunctors"
...
...
src/Gargantext/Components/GraphQL/User.purs
View file @
984e2035
module Gargantext.Components.GraphQL.User where
import Data.Maybe (Maybe(..), maybe)
import Gargantext.Prelude
import Data.Maybe (Maybe(..), maybe)
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (HyperdataUser(..))
import GraphQL.Client.GetFields (getFieldsStandard)
import Type.Proxy (Proxy(..))
uFields = getFieldsStandard (Proxy :: _ User)
huFields = getFieldsStandard (Proxy :: _ HyperdataUser)
type User
= { u_id :: Int
, u_hyperdata ::
...
...
src/Gargantext/Components/Nodes/Annuaire/User.purs
View file @
984e2035
...
...
@@ -16,6 +16,7 @@ import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.GraphQL (queryGql)
import Gargantext.Components.GraphQL.User (uFields, huFields)
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Nodes.Annuaire.Tabs as Tabs
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (Contact(..), ContactData, ContactTouch(..), ContactWhere(..), ContactWho(..), HyperdataContact(..), HyperdataUser(..), _city, _country, _firstName, _labTeamDeptsJoinComma, _lastName, _mail, _office, _organizationJoinComma, _ouFirst, _phone, _role, _shared, _touch, _who, defaultContactTouch, defaultContactWhere, defaultContactWho, defaultHyperdataContact, defaultHyperdataUser)
...
...
@@ -245,17 +246,18 @@ getUser session id = do
{ users } <- queryGql "get user"
{ users: { user_id: id } =>>
{ u_id
, u_hyperdata:
{ _hu_shared:
{ _hc_title
, _hc_source
, _hc_who:
{ _cw_firstName
, _cw_lastName }
, _hc_where:
{ _cw_organization }
}
}
, u_hyperdata: huFields
-- , u_hyperdata:
-- { _hu_shared:
-- { _hc_title
-- , _hc_source
-- , _hc_who:
-- { _cw_firstName
-- , _cw_lastName }
-- , _hc_where:
-- { _cw_organization }
-- }
-- }
, u_username
, u_email } }
liftEffect $ here.log2 "[getUser] users" users
...
...
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