Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume WANG
gdd-sigma-poc
Commits
d65c57cf
Commit
d65c57cf
authored
7 years ago
by
Wilson JALLET
Browse files
Options
Downloads
Plain Diff
yop
parents
579c3a5f
a8d5660c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/graphql/schema.js
+1
-13
1 addition, 13 deletions
src/graphql/schema.js
src/graphql/typeDefs.js
+33
-9
33 additions, 9 deletions
src/graphql/typeDefs.js
with
34 additions
and
22 deletions
src/graphql/schema.js
+
1
−
13
View file @
d65c57cf
...
@@ -91,17 +91,13 @@ const resolvers = {
...
@@ -91,17 +91,13 @@ const resolvers = {
}
}
},
},
Requests
:
{
All
Requests
:
{
userJoinGroup
:
(
obj
,
args
,
context
)
=>
{
userJoinGroup
:
(
obj
,
args
,
context
)
=>
{
return
db_utils
.
getUserJoinGroupRequests
(
context
.
user
,
args
.
groupUID
);
return
db_utils
.
getUserJoinGroupRequests
(
context
.
user
,
args
.
groupUID
);
},
},
},
},
UserJoinGroup
:
{
UserJoinGroup
:
{
id
:
(
obj
,
args
,
context
)
=>
{
return
obj
.
id
;
},
user
:
(
obj
,
args
,
context
)
=>
{
user
:
(
obj
,
args
,
context
)
=>
{
return
db_utils
.
getUser
(
context
.
user
,
obj
.
useruid
);
return
db_utils
.
getUser
(
context
.
user
,
obj
.
useruid
);
/*return db_utils.getUser(context.user, "quentin.gendre");
/*return db_utils.getUser(context.user, "quentin.gendre");
...
@@ -118,10 +114,6 @@ const resolvers = {
...
@@ -118,10 +114,6 @@ const resolvers = {
},
},
GroupJoinEvent
:
{
GroupJoinEvent
:
{
id
:
(
obj
,
args
,
context
)
=>
{
return
obj
.
id
;
},
event
:
(
obj
,
args
,
context
)
=>
{
event
:
(
obj
,
args
,
context
)
=>
{
return
db_utils
.
getEvent
(
context
.
user
,
obj
.
eventuid
);
return
db_utils
.
getEvent
(
context
.
user
,
obj
.
eventuid
);
},
},
...
@@ -131,10 +123,6 @@ const resolvers = {
...
@@ -131,10 +123,6 @@ const resolvers = {
},
},
YourGroupHostEvent
:
{
YourGroupHostEvent
:
{
id
:
(
obj
,
args
,
context
)
=>
{
return
obj
.
id
;
},
event
:
(
obj
,
args
,
context
)
=>
{
event
:
(
obj
,
args
,
context
)
=>
{
return
db_utils
.
getEvent
(
context
.
user
,
obj
.
eventuid
);
return
db_utils
.
getEvent
(
context
.
user
,
obj
.
eventuid
);
},
},
...
...
This diff is collapsed.
Click to expand it.
src/graphql/typeDefs.js
+
33
−
9
View file @
d65c57cf
...
@@ -11,7 +11,9 @@ const RootTypes = `
...
@@ -11,7 +11,9 @@ const RootTypes = `
allAnnouncements: [Announcement]
allAnnouncements: [Announcement]
asAdmin(groupUID: ID): AdminQuery
asAdmin(groupUID: ID): AdminQuery
asSpeaker(groupUID: ID): AdminQuery
asMember(groupUID: ID): AdminQuery
asViewer(groupUID: ID): AdminQuery
searchTOL(
searchTOL(
givenName: String,
givenName: String,
...
@@ -69,6 +71,7 @@ const subMutations = `
...
@@ -69,6 +71,7 @@ const subMutations = `
type SpeakerMutation{
type SpeakerMutation{
postEvent(name: String, date: String): Event
postEvent(name: String, date: String): Event
answerRequest(request: ID, accept : Boolean): Request
}
}
type MemberMutation {
type MemberMutation {
...
@@ -79,13 +82,26 @@ const subMutations = `
...
@@ -79,13 +82,26 @@ const subMutations = `
requestJoin: Group
requestJoin: Group
}
}
`
;
`
;
const
subQueries
=
`
const
subQueries
=
`
# Requête à la base de donnée nécessitant d'être administrateur.
# Requête à la base de donnée nécessitant d'être administrateur.
type AdminQuery{
type AdminQuery{
isAdmin: Boolean
isAdmin: Boolean
allRequests : Requests
allRequests : AllRequests
}
type SpeakerQuery{
isSpeaker: Boolean
}
type MemberQuery{
isMember: Boolean
}
type ViewerQuery{
isViewer: Boolean
}
}
`
;
`
;
...
@@ -190,25 +206,32 @@ const Event = `
...
@@ -190,25 +206,32 @@ const Event = `
const
Requests
=
`
const
Requests
=
`
# Demandes effectuées au groupe.
# Demandes effectuées au groupe.
type Requests {
type
All
Requests {
userJoinGroup: [UserJoinGroup]
userJoinGroup: [UserJoinGroup]
groupJoinEvent: [GroupJoinEvent]
groupJoinEvent: [GroupJoinEvent]
yourGroupHostEvent: [YourGroupHostEvent]
yourGroupHostEvent: [YourGroupHostEvent]
}
}
interface Request {
# ID de la demande
id: ID!
# message accompagnant la demande
message: String
}
# Demande d'un utilisateur désirant rejoindre le groupe.
# Demande d'un utilisateur désirant rejoindre le groupe.
type UserJoinGroup {
type UserJoinGroup
implements Request
{
id: ID!
id: ID!
message: String
# Émetteur de la demande
# Émetteur de la demande
user: User
user: User
# message accompagnant la demande
message: String
}
}
# Demande d'un groupe voulant rejoindre un événement
# Demande d'un groupe voulant rejoindre un événement
type GroupJoinEvent {
type GroupJoinEvent
implements Request
{
id: ID!
id: ID!
message: String
# Événement concerné
# Événement concerné
event: Event
event: Event
# Groupe voulant rejoindre l'événement
# Groupe voulant rejoindre l'événement
...
@@ -216,8 +239,9 @@ const Requests = `
...
@@ -216,8 +239,9 @@ const Requests = `
}
}
# Demande au récipiendaire de rejoindre l'organisation d'un événement.
# Demande au récipiendaire de rejoindre l'organisation d'un événement.
type YourGroupHostEvent {
type YourGroupHostEvent implements Request{
id: ID!
requestID: ID
message: String
# Événement concerné
# Événement concerné
event: Event
event: Event
# Groupe ayant publié l'évènement et lancé l'invitation
# Groupe ayant publié l'évènement et lancé l'invitation
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment