This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtypeDefs.graphql
55 lines (49 loc) · 1.53 KB
/
typeDefs.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
enum OrderBy {
ASCENDING
DESCENDING
}
# Sort and order results by a specific field and order.
# e.g - { sortBy: "date", orderBy: "DESCENDING" }
input Sort {
# Field to sort by. e.g - "date"
sortBy: String!
# ASCENDING or DESCENDING order. e.g - "DESCENDING"
orderBy: OrderBy!
}
input Pagination {
# Sort and order objects by a specific field in a specific order.
sort: Sort
# Do not return the first x objects.
skip: Int
# Limit the number of objects to return.
limit: Int
}
input Fields {
id: ID
groupId: ID
html: String
# field defs generated from .md front-matter will be injected by pkg here.
}
type ContentItem {
# Mandatory - a unique id must exist for every .md file.
id: ID!
# Mandatory - a non unique groupId must exist for every .md file. If you do not
# wish to manually set you can use the generateGroupIdByFolder option check pkg Readme.
groupId: ID!
# The html generated from parsing the .md contents.
html: String
# field defs generated from .md front-matter will be injected by pkg here.
}
input FilterFields {
# Query ContentItems by any fields using logical AND condition.
AND: Fields
# Query ContentItems by any fields using logical OR condition.
OR: [Fields!]
}
type Query {
contentItemById(id: ID!): ContentItem
contentItemsByIds(ids: [ID!]!, pagination: Pagination): [ContentItem!]
contentItemsByGroupId(groupId: ID!, pagination: Pagination): [ContentItem!]
# Query for contentItems by any field
contentItems(filter: FilterFields!, pagination: Pagination): [ContentItem!]
}