forked from PalisadoesFoundation/talawa-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
81 lines (67 loc) · 1.66 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const { gql } = require("apollo-server-express");
const typeDefs = gql`
type User {
_id: ID!
firstName: String!
lastName: String!
email: String!
password: String
createdOrganizations: [Organization]
joinedOrganizations: [Organization]
adminFor: [Organization]
}
type Organization {
_id: ID!
name:String!
description: String!
isPublic: Boolean!
creator: User!
members: [User]
admins(adminId: ID): [User]
}
input UserInput {
firstName: String!
lastName: String!
email: String!
password: String!
}
input LoginInput {
email:String!,
password:String!
}
type AuthData {
userId: ID!
token:String!
}
type Query {
users(id: ID): [User],
login(data: LoginInput!): AuthData!
organizations(id: ID): [Organization]
me:User!
}
input OrganizationInput {
name:String!
description: String!
isPublic: Boolean!
}
input UpdateOrganizationInput {
name:String
description: String
isPublic: Boolean
}
input UserAndOrganizationInput{
organizationId: ID!, userId: ID!
}
type Mutation {
signUp(data: UserInput!): AuthData!
createOrganization(data: OrganizationInput): Organization!
updateOrganization(id:ID!, data: UpdateOrganizationInput) : Organization!
removeOrganization(id: ID!) : Organization!
createAdmin (data: UserAndOrganizationInput!) : User!
removeAdmin (data: UserAndOrganizationInput!) : User!
joinPublicOrganization (organizationId: ID!) : User!
leaveOrganization (organizationId: ID!) : User!
removeMember (data: UserAndOrganizationInput!) : User!
}
`
module.exports = typeDefs