-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema_extension.faker.graphql
138 lines (113 loc) · 3.57 KB
/
schema_extension.faker.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
schema {
mutation: RootMutation
}
type RootMutation {
setViewComponents(input: ViewComponentsInput): Boolean
setFacets(input: FacetsInput): Boolean
}
# -------- Components (mutation inputs)
input ViewComponentsInput {
components: [ComponentInput]
dataSetId: String!
collectionId: String!
query: String! #graphql syntax like string
}
input ComponentInput {
type: ComponentType! # depending on this type, you can expect an x amount of fields => this can be traced back in the GUI, which is in charge of the view configuration
value: ComponentValueInput
key: ComponentValueInput
title: ComponentValueInput
url: ComponentValueInput
alt: ComponentValueInput
values: [ ComponentInput ]
}
input ComponentValueInput {
field: String # Can hold either a field or a fields object. Inputs do not get along with unions, that's why this is not more typesafe
fields: [ComponentValueFieldInput]
}
input ComponentValueFieldInput {
value: String
referenceType: String
}
input ComponentValueFieldInput {
value: String
referenceType: String
}
# -------- Components (Query)
type Component {
type: ComponentType! # depending on this type, you can expect an x amount of fields => this can be traced back in the GUI, which is in charge of the view configuration
value: ComponentValue
key: ComponentValue
title: ComponentValue
url: ComponentValue
alt: ComponentValue
tree: String @examples(values: ["{'a':{'b':'1','c':{'d':'2','e':'3'}},'f':'4'}"]) # a stringified object to ensure we do not have to know how many levels deep we need to go
values: [ Component ]
}
type ComponentValue {
field: String @examples(values: ["Hardcoded example string"])
fields: [ String ] @examples(values:["level one", "level two", "level three", "level four"])
}
type ComponentValueField {
value: String
referenceType: String
}
enum ComponentType {
TITLE
VALUE
IMAGE
LINK
DIVIDER
KEYVALUE
TREE
}
# -------- Facets (mutation inputs)
input FacetsInput {
facets: [FacetInput]
}
input FacetInput {
caption: String!
options: [OptionInput!]!
}
input OptionInput {
name: String!
value: String! # used like this: "levelOne.levelTwo.levelThree.levelFour"
}
# -------- Facets (Query)
type Facet {
caption: String! @fake(type: productCategory)
options: [Option!]!
}
type Option {
name: String! @fake(type: productName)
count: Int! @fake(type:money)
}
# -------- Metadata (Query)
extend type DataSetMetadata {
contributors: [RoleWithMembers!]!
roles: [DataSetPermission!]!
# FIXME:
# collectionList(cursor, count): CollectionMetadataList <= this is currently collections, should be divided in 'collectionList' and 'collection'
# collection(collectionId): CollectionMetadata
}
extend type CollectionMetadata {
components(count: Int = 20, cursor: ID = ""): ComponentList!
}
type ComponentList {
prevCursor: ID
nextCursor: ID
query: String # this is the graphql syntax like string from the ViewComponentsInput
items: [Component!]!
}
type RoleWithMembers {
name: String
}
enum DataSetPermission {
SEARCH_AND_VIEW #Is allowed to search the dataset and query it using graphql
DOWNLOAD_DUMP #Is allowed to download raw rdf files with the data and query for recent changes
FORK #Is allowed to fork the dataset (into a new dataset)
PUBLISH #Is allowed to change this dataset into a publicly visible one
EDIT_ENTRIES #Is allowed to edit entries using the REST endpoint
EDIT_DATASET #Is allowed to upload rdf data/change dataset metadata/upload files etc.
EDIT_ROLES #Is allowed to assign roles to users
}