-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcatalog.graphql
169 lines (152 loc) · 5.84 KB
/
catalog.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
type KeyValuePair {
key: String!
value: String!
}
union Ownable = API | Component | Domain | Resource | System | Template
union Dependency = Component | Resource
union Owner = User | Group
extend interface Entity
@discriminates(with: "kind", opaqueType: "OpaqueEntity") {
name: String! @field(at: "metadata.name")
kind: String! @field(at: "kind")
namespace: String! @field(at: "metadata.namespace", default: "default")
apiVersion: String! @field(at: "apiVersion")
title: String @field(at: "metadata.title")
description: String @field(at: "metadata.description")
labels: [KeyValuePair!] @field(at: "metadata.labels") @sourceType(name: "JSONObject")
annotations: [KeyValuePair!] @field(at: "metadata.annotations") @sourceType(name: "JSONObject")
tags: [String!] @field(at: "metadata.tags")
links: [EntityLink!] @field(at: "metadata.links")
relations: [Relation!] @field(at: "relations")
}
type EntityLink {
url: String!
title: String
icon: String
type: String
}
type Relation {
type: String!
# FIXME: @resolve/@field directives work only on top level of node object
# target: Entity @resolve(at: "targetRef")
targetRef: EntityRef @sourceType(name: "String")
}
type EntityRef {
kind: String!
namespace: String!
name: String!
}
interface Location
@implements(interface: "Entity")
@discriminates(with: "spec.type", opaqueType: "OpaqueLocation")
@discriminationAlias(value: "url", type: "URLLocation")
@discriminationAlias(value: "file", type: "FileLocation") {
type: String @field(at: "spec.type")
target: String @field(at: "spec.target")
targets: [String!] @field(at: "spec.targets")
presence: String @field(at: "spec.presence")
}
interface API
@implements(interface: "Entity")
@discriminates(with: "spec.type", opaqueType: "OpaqueAPI")
@discriminationAlias(value: "openapi", type: "OpenAPI")
@discriminationAlias(value: "asyncapi", type: "AsyncAPI")
@discriminationAlias(value: "graphql", type: "GraphQL")
@discriminationAlias(value: "grpc", type: "GRPC") {
type: String! @field(at: "spec.type")
lifecycle: String! @field(at: "spec.lifecycle")
owner: Owner! @relation(name: "ownedBy")
definition: String! @field(at: "spec.definition")
system: System @relation(name: "partOf")
apiConsumedBy: Connection
@relation(name: "apiConsumedBy", nodeType: "Component")
apiProvidedBy: Connection
@relation(name: "apiProvidedBy", nodeType: "Component")
}
interface Component
@implements(interface: "Entity")
@discriminates(with: "spec.type", opaqueType: "OpaqueComponent")
@discriminationAlias(value: "service", type: "Service")
@discriminationAlias(value: "website", type: "Website")
@discriminationAlias(value: "library", type: "Library") {
type: String! @field(at: "spec.type")
lifecycle: String! @field(at: "spec.lifecycle")
owner: Owner! @relation(name: "ownedBy")
system: System @relation(name: "partOf", kind: "system")
subComponentOf: Component @relation(name: "partOf", kind: "component")
providesApis: Connection @relation(name: "providesApi", nodeType: "API")
consumesApis: Connection @relation(name: "consumesApi", nodeType: "API")
dependsOn: Connection @relation(name: "dependsOn", nodeType: "Dependency")
dependencyOf: Connection
@relation(name: "dependencyOf", nodeType: "Dependency")
components: Connection @relation(name: "hasPart", nodeType: "Component")
}
type Domain @implements(interface: "Entity") {
owner: Owner! @relation(name: "ownedBy")
systems: Connection @relation(name: "hasPart", nodeType: "System")
}
interface Resource
@implements(interface: "Entity")
@discriminates(with: "spec.type", opaqueType: "OpaqueResource")
@discriminationAlias(value: "database", type: "Database") {
type: String! @field(at: "spec.type")
owner: Owner! @relation(name: "ownedBy")
dependsOn: Connection @relation(name: "dependsOn", nodeType: "Dependency")
dependencyOf: Connection
@relation(name: "dependencyOf", nodeType: "Dependency")
system: System @relation(name: "partOf")
}
type System @implements(interface: "Entity") {
owner: Owner! @relation(name: "ownedBy")
domain: Domain @relation(name: "partOf")
apis: Connection @relation(name: "hasPart", nodeType: "API", kind: "api")
components: Connection
@relation(name: "hasPart", nodeType: "Component", kind: "component")
resources: Connection
@relation(name: "hasPart", nodeType: "Resource", kind: "resource")
}
type Step {
id: String
name: String
action: String!
input: JSONObject
if: JSON
}
interface Template
@implements(interface: "Entity")
@discriminates(with: "spec.type", opaqueType: "OpaqueTemplate")
@discriminationAlias(value: "service", type: "ServiceTemplate") {
type: String! @field(at: "spec.type")
parameters: JSONObject @field(at: "spec.parameters")
steps: [Step!]! @field(at: "spec.steps")
owner: Owner @relation(name: "ownedBy")
}
type GroupProfile {
displayName: String
email: String
picture: String
}
interface Group
@implements(interface: "Entity")
@discriminates(with: "spec.type", opaqueType: "OpaqueGroup")
@discriminationAlias(value: "team", type: "Team")
@discriminationAlias(value: "sub-department", type: "SubDepartment")
@discriminationAlias(value: "department", type: "Department")
@discriminationAlias(value: "organization", type: "Organization") {
type: String! @field(at: "spec.type")
profile: GroupProfile @field(at: "spec.profile")
parent: Group @relation(name: "childOf")
children: Connection @relation(name: "parentOf", nodeType: "Group")
members: Connection @relation(name: "hasMember", nodeType: "User")
ownerOf: Connection @relation(name: "ownerOf", nodeType: "Ownable")
}
type UserProfile {
displayName: String
email: String
picture: String
}
type User @implements(interface: "Entity") {
profile: UserProfile @field(at: "spec.profile")
memberOf: Connection @relation(nodeType: "Group")
ownerOf: Connection @relation(nodeType: "Ownable")
}