-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
96 lines (89 loc) · 1.49 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
fragment postSummaryFields on Post {
id
title
updatedAt(variation: BASE)
createdAt(variation: BASE)
excerpt
slug
tags {
...tagFields
}
}
fragment postDetailsFields on Post {
content
id
title
excerpt
tags(orderBy: name_DESC) {
name
id
slug
}
createdAt(variation: BASE)
updatedAt(variation: BASE)
}
fragment tagFields on Tag {
name
id
slug
}
fragment postCountFields on PostConnection {
aggregate {
count
}
}
fragment coverImageFields on Post {
coverImage(locales: en_US) {
url(
transformation: {
image: { resize: { height: 250, width: 250, fit: scale } }
}
)
}
}
query GetIndexContent(
$locales: [Locale!]!
$orderBy: PostOrderByInput!
$skip: Int!
$limit: Int!
) {
posts(locales: $locales, orderBy: $orderBy, skip: $skip, first: $limit) {
id
title
updatedAt(variation: BASE)
createdAt(variation: BASE)
excerpt
slug
tags {
...tagFields
}
}
tags {
...tagFields
}
postsConnection {
...postCountFields
}
}
query GetPostBySlug($slug: String!, $locales: [Locale!]!) {
post(where: { slug: $slug }, locales: $locales) {
...postDetailsFields
tags(orderBy: name_DESC) {
...tagFields
}
...coverImageFields
}
}
query GetPostsByTag(
$tagSlug: String!
$locales: [Locale!]!
$orderBy: PostOrderByInput
) {
posts(
where: { tags_some: { slug: $tagSlug } }
locales: $locales
orderBy: $orderBy
) {
...postSummaryFields
}
}