Search…
GraphQL Metadata API
Datafold exposes a GraphQL Metadata API that allows exporting metadata such as table and column descriptions and lineage.
The API has the following schema:
1
directive @auth on FIELD_DEFINITION
2
directive @perm(allow: [String!]!) on FIELD_DEFINITION
3
4
# Base types
5
scalar Datetime
6
7
8
interface BaseItem {
9
uid: ID!
10
}
11
12
interface PagedResult {
13
page: PageInfo!
14
}
15
16
type PageInfo {
17
cursor: ID
18
total: Int!
19
page: Int!
20
first: Int!
21
}
22
23
type TableList implements PagedResult {
24
page: PageInfo!
25
items: [Table!]
26
}
27
28
type ColumnList implements PagedResult {
29
page: PageInfo!
30
items: [Column!]
31
}
32
33
type TagList implements PagedResult {
34
page: PageInfo!
35
items: [Tag!]
36
}
37
38
type TagConnectionsList implements PagedResult {
39
page: PageInfo!
40
items: [TagConnections!]
41
}
42
43
type Tag implements BaseItem {
44
uid: ID!
45
name: String!
46
color: String
47
attached: Boolean!
48
connections (first: Int, cursor: ID): TagConnectionsList
49
}
50
51
type Organization implements BaseItem {
52
uid: ID!
53
name: String!
54
users: [User!] @perm(allow:["list_users"])
55
dataSources: [DataSource!] @perm(allow:["list_data_sources"])
56
}
57
58
type User implements BaseItem {
59
uid: ID!
60
org: Organization!
61
name: String!
62
email: String!
63
}
64
65
type DataSource implements BaseItem {
66
uid: ID!
67
name: String!
68
type: String!
69
owner: User!
70
org: Organization!
71
hasSchemeIndexing: Boolean!
72
discourageManualProfiling: Boolean!
73
createdAt: Datetime!
74
tables (first: Int, cursor: ID): TableList!
75
}
76
77
type Table implements BaseItem {
78
uid: ID!
79
prop: TableProp!
80
descriptions: [TableDesc!]
81
tagIds: [ID!]
82
tags: [Tag!]
83
columnIds: [ID!]
84
columns: [Column!]
85
}
86
87
type TableProp {
88
path: String!
89
dataSourceId: ID!
90
createdBySessionIds: [ID!]
91
}
92
93
type TableDesc {
94
userId: ID!
95
dataOwnerId: ID!
96
description: String
97
}
98
99
type Column implements BaseItem{
100
uid: ID!
101
tableId: ID!
102
table: Table!
103
prop: ColumnProp!
104
descriptions: [ColumnDesc!]
105
tagIds: [ID!]
106
tags: [Tag!]
107
upstreamIds: [ID!]
108
upstream: [Column!]
109
downstreamIds: [ID!]
110
downstream: [Column!]
111
}
112
113
type ColumnProp {
114
name: String!
115
type: String!
116
dbType: String!
117
number: Int
118
description: String
119
}
120
121
type ColumnDesc {
122
userId: ID!
123
description: String
124
}
125
126
# Unions
127
128
union SearchedItem = Tag | Table | Column
129
union TagConnections = Table | Column
130
131
# Lineage items
132
133
enum LineageDirection {
134
UPSTREAM,
135
DOWNSTREAM
136
}
137
138
type LineageResult {
139
primary: Table!
140
tables: [Table!]
141
columns: [Column!]
142
edges: [LineageEdge!]
143
}
144
145
type LineageEdge {
146
direction: LineageDirection!
147
sourceId: ID!
148
destinationId: ID
149
}
150
151
# Search items
152
153
enum SearchLabel {
154
Table
155
Column
156
Tag
157
}
158
159
type SearchStatId {
160
count: Int!
161
item: ID!
162
}
163
164
type SearchStatTag {
165
count: Int!
166
tag: Tag!
167
}
168
169
type SearchStatLabel {
170
count: Int!
171
item: SearchLabel!
172
}
173
174
type SearchResult {
175
score: Float!
176
item: SearchedItem!
177
}
178
179
type SearchStats {
180
dataSources: [SearchStatId!]!
181
tags: [SearchStatTag!]!
182
dataOwnerIds: [SearchStatId!]!
183
labels: [SearchStatLabel!]!
184
}
185
186
type SearchList implements PagedResult {
187
page: PageInfo!
188
stats: SearchStats!
189
results: [SearchResult!]
190
}
191
192
type Query {
193
version: String
194
# Complex methods
195
lineage(
196
tableUid: ID!
197
): LineageResult! @auth
198
# Selection
199
search(
200
query: String,
201
paths: [String!]
202
tagUids: [ID!]
203
dataOwnerIds: [Int!]
204
labels: [SearchLabel!]
205
ranking: Boolean
206
first: Int
207
cursor: ID
208
): SearchList! @auth
209
# Base methods
210
me: User! @auth
211
org: Organization! @auth
212
# Batch methods
213
tables(uids: [ID!], dataSourceId: ID, first: Int, cursor: ID): TableList @auth
214
columns(uids: [ID!]!): ColumnList @auth
215
tags(uids: [ID!], first: Int, cursor: ID): TagList @auth
216
# ID get methods
217
table(uid: ID, path: String): Table @auth
218
column(uid: ID!): Column @auth
219
tag(uid: ID!): Tag @auth
220
}
221
222
schema {
223
query: Query
224
}
Copied!
Last modified 22d ago
Copy link