-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
47 lines (42 loc) · 1.06 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
type Mutation {
# In this example, only users in the ManagerGroup can create tasks
createTask(
owner: String!,
title: String!,
taskStatus: String!,
description: String!
): Task!
@aws_auth(cognito_groups: ["ManagerGroup"])
# Both Employees and Managers can update a task's status
updateTaskStatus(id: ID!, taskStatus: String!): Task!
@aws_auth(cognito_groups: ["EmployeeGroup","ManagerGroup"])
updateTaskBody(id: ID!, title: String!, description: String!): Task!
@aws_auth(cognito_groups: ["ManagerGroup"])
}
type Query {
# Users belonging to both EmployeesGroup and ManagerGroup can read a particular task
getTask(id: ID!): Task!
@aws_auth(cognito_groups: ["EmployeeGroup","ManagerGroup"])
# Only Managers can list all the Tasks
allTasks(nextToken: String): TaskConnection!
@aws_auth(cognito_groups: ["ManagerGroup"])
}
type Task {
id: ID!
owner: String!
title: String!
description: String!
taskStatus: String
}
type TaskConnection {
items: [Task]
nextToken: String
}
schema {
query: Query
mutation: Mutation
}
enum TaskType {
Task,
Story
}