Skip to content

Commit 9fbc78c

Browse files
committed
update schema
1 parent c780ca6 commit 9fbc78c

File tree

5 files changed

+173
-1
lines changed

5 files changed

+173
-1
lines changed

graphqlServer/dab-config.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,27 @@
5656
]
5757
}
5858
]
59+
},
60+
"Summary": {
61+
"source": {
62+
"object": "test"
63+
},
64+
"graphql": {
65+
"enabled": false
66+
},
67+
"rest": {
68+
"enabled": false
69+
},
70+
"permissions": [
71+
{
72+
"role": "anonymous",
73+
"actions": [
74+
{
75+
"action": "*"
76+
}
77+
]
78+
}
79+
]
5980
}
6081
}
6182
}

graphqlServer/schema.graphql

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ type Engagement @model {
66
programName: String
77
startDate: String
88
endDate: String
9+
domain: String
10+
currency: String
911
lastModifiedDate: String
1012
lastApprovedDate: String
11-
}
13+
summaries: [Summary]
14+
}
15+
16+
type Summary {
17+
id: String
18+
name: String
19+
description: String
20+
startDate: String
21+
endDate: String
22+
}

graphqlServer/testdata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"programName": "Program 1",
88
"startDate": "2023-01-01",
99
"endDate": "2027-12-31",
10+
"domain": "Royalties",
1011
"lastModifiedDate": "2023-01-01",
1112
"lastApprovedDate": "2023-01-01"
1213
},
@@ -18,6 +19,7 @@
1819
"programName": "Program 2",
1920
"startDate": "2023-05-01",
2021
"endDate": "2028-12-31",
22+
"domain": "Royalties",
2123
"lastModifiedDate": "2023-01-13",
2224
"lastApprovedDate": "2023-01-13"
2325
},
@@ -29,6 +31,7 @@
2931
"programName": "Program 3",
3032
"startDate": "2023-01-01",
3133
"endDate": "2024-12-31",
34+
"domain": "Seller incentives",
3235
"lastModifiedDate": "2023-01-21"
3336
}
3437
]

test/dab-config.json

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v1.2.10/dab.draft.schema.json",
3+
"data-source": {
4+
"database-type": "cosmosdb_nosql",
5+
"connection-string": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;",
6+
"options": {
7+
"database": "stacy-clouds",
8+
"container": null,
9+
"schema": "schema.graphql"
10+
}
11+
},
12+
"runtime": {
13+
"rest": {
14+
"enabled": false,
15+
"path": "/api",
16+
"request-body-strict": true
17+
},
18+
"graphql": {
19+
"enabled": true,
20+
"path": "/graphql",
21+
"allow-introspection": true
22+
},
23+
"host": {
24+
"cors": {
25+
"origins": [],
26+
"allow-credentials": false
27+
},
28+
"authentication": {
29+
"provider": "StaticWebApps"
30+
},
31+
"mode": "development"
32+
}
33+
},
34+
"entities": {
35+
"Engagement": {
36+
"source": {
37+
"object": "engagements"
38+
},
39+
"graphql": {
40+
"enabled": true,
41+
"type": {
42+
"singular": "Engagement",
43+
"plural": "Engagements"
44+
}
45+
},
46+
"rest": {
47+
"enabled": false
48+
},
49+
"permissions": [
50+
{
51+
"role": "anonymous",
52+
"actions": [
53+
{
54+
"action": "read"
55+
}
56+
]
57+
}
58+
]
59+
},
60+
"Talk": {
61+
"source": {
62+
"object": "talks"
63+
},
64+
"graphql": {
65+
"enabled": true,
66+
"type": {
67+
"singular": "Talk",
68+
"plural": "Talks"
69+
}
70+
},
71+
"rest": {
72+
"enabled": false
73+
},
74+
"permissions": [
75+
{
76+
"role": "anonymous",
77+
"actions": [
78+
{
79+
"action": "read"
80+
}
81+
]
82+
}
83+
]
84+
},
85+
"ConferenceTalk": {
86+
"source": {
87+
"object": "test"
88+
},
89+
"graphql": {
90+
"enabled": false
91+
},
92+
"rest": {
93+
"enabled": false
94+
},
95+
"permissions": [
96+
{
97+
"role": "anonymous",
98+
"actions": [
99+
{
100+
"action": "read"
101+
}
102+
]
103+
}
104+
]
105+
}
106+
}
107+
}

test/schema.graphql

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
type Engagement @model {
2+
id: ID!
3+
name: String!
4+
internalName: String
5+
status: String!
6+
programName: String
7+
startDate: String
8+
endDate: String
9+
domain: String
10+
currency: String
11+
lastModifiedDate: String
12+
lastApprovedDate: String
13+
talks: [ConferenceTalk]
14+
}
15+
16+
type ConferenceTalk {
17+
id: String
18+
title: String
19+
abstract: String
20+
mainTag: String
21+
talkTime: String
22+
talkLength: Int
23+
tags: [String]
24+
}
25+
26+
type Talk @model {
27+
id: String
28+
title: String
29+
mainTag: String
30+
}

0 commit comments

Comments
 (0)