This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestSchema.graphql
99 lines (88 loc) · 2.22 KB
/
testSchema.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
type Customer
@model
@auth(rules: [
{ allow: groups, groups: ["Admins"] },
{ allow: private, provider: iam, operations: [read, update] }
]) {
id: ID!
firstName: String!
lastName: String!
active: Boolean!
address: String!
}
type Product
@model
@auth(rules: [
{ allow: groups, groups: ["Admins"] },
{ allow: public, provider: iam, operations: [read] }
]) {
id: ID!
name: String!
description: String!
price: String!
active: Boolean!
added: AWSDateTime!
orders: [Order] @connection
}
# TODO: handle the subscription case when auth is not added - it doesn't create a subscription resolver
type Order @model
@key(fields: ["id", "productID"]) {
id: ID!
productID: ID!
total: String!
ordered: AWSDateTime!
}
type Blog @model {
id: ID!
name: String!
posts: [Post] @connection(name: "BlogPosts")
}
type Post @model {
id: ID!
title: String!
blog: Blog @connection(name: "BlogPosts")
comments: [Comment] @connection(name: "PostComments")
}
type Comment @model {
id: ID!
content: String
post: Post @connection(name: "PostComments")
}
# Demonstrate the FUNCTION resolvers
type User @model(queries: null, mutations: null, subscriptions: null)
@auth(rules: [
{ allow: groups, groups: ["Admins"] },
{ allow: owner, ownerField: "sub" },
{ allow: private, provider: iam, operations: [create, update] }
]) {
id: ID!
enabled: Boolean!
status: String!
email: String!
name: String!
email_verified: String
phone_number: String
phone_number_verified: String
}
type UserConnection {
items: [User]
}
input CreateUserInput {
email: String!
name: String!
}
input UpdateUserInput {
id: ID!
email: String
name: String
number: String
}
# Demonstrate the FUNCTION resolvers
type Query {
listUsers: UserConnection @function(name: "currently-unused")
getUser(id: ID!): User @function(name: "currently-unused")
}
type Mutation {
createUser(input: CreateUserInput!): User @function(name: "currently-unused")
updateUser(input: UpdateUserInput!): User @function(name: "currently-unused")
}