Skip to content

Commit 8f8dc5c

Browse files
Updating the simplified types (#86)
- Updating example packages to v2.0.2 - Updating types to make use of simplified types of examples and tests
1 parent 5603c34 commit 8f8dc5c

File tree

6 files changed

+47
-9
lines changed

6 files changed

+47
-9
lines changed

examples/simple/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,26 @@ async function dropAll(dgraphClient) {
2121
// Set schema.
2222
async function setSchema(dgraphClient) {
2323
const schema = `
24+
type Person {
25+
name
26+
age
27+
married
28+
loc
29+
dob
30+
friend
31+
school
32+
}
33+
34+
type School {
35+
name
36+
}
37+
2438
name: string @index(exact) .
2539
age: int .
2640
married: bool .
2741
loc: geo .
2842
dob: datetime .
43+
friend: [uid] @reverse .
2944
`;
3045
const op = new dgraph.Operation();
3146
op.setSchema(schema);
@@ -41,6 +56,7 @@ async function createData(dgraphClient) {
4156
const p = {
4257
uid: "_:alice",
4358
name: "Alice",
59+
"dgraph.type": "Person",
4460
age: 26,
4561
married: true,
4662
loc: {
@@ -51,16 +67,19 @@ async function createData(dgraphClient) {
5167
friend: [
5268
{
5369
name: "Bob",
70+
"dgraph.type": "Person",
5471
age: 24,
5572
},
5673
{
5774
name: "Charlie",
75+
"dgraph.type": "Person",
5876
age: 29,
5977
}
6078
],
6179
school: [
6280
{
6381
name: "Crown Public School",
82+
"dgraph.type": "School",
6483
}
6584
]
6685
};

examples/simple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "simple",
33
"dependencies": {
4-
"dgraph-js": "^2.0.1",
4+
"dgraph-js": "^2.0.2",
55
"grpc": "^1.23.3"
66
}
77
}

examples/tls/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,26 @@ async function dropAll(dgraphClient) {
3333
// Set schema.
3434
async function setSchema(dgraphClient) {
3535
const schema = `
36+
type Person {
37+
name
38+
age
39+
married
40+
loc
41+
dob
42+
friend
43+
school
44+
}
45+
46+
type School {
47+
name
48+
}
49+
3650
name: string @index(exact) .
3751
age: int .
3852
married: bool .
3953
loc: geo .
4054
dob: datetime .
55+
friend: [uid] @reverse .
4156
`;
4257
const op = new dgraph.Operation();
4358
op.setSchema(schema);
@@ -53,6 +68,7 @@ async function createData(dgraphClient) {
5368
const p = {
5469
uid: "_:alice",
5570
name: "Alice",
71+
"dgraph.type": "Person",
5672
age: 26,
5773
married: true,
5874
loc: {
@@ -63,16 +79,19 @@ async function createData(dgraphClient) {
6379
friend: [
6480
{
6581
name: "Bob",
82+
"dgraph.type": "Person",
6683
age: 24,
6784
},
6885
{
6986
name: "Charlie",
87+
"dgraph.type": "Person",
7088
age: 29,
7189
}
7290
],
7391
school: [
7492
{
7593
name: "Crown Public School",
94+
"dgraph.type": "School",
7695
}
7796
]
7897
};

examples/tls/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tls",
33
"dependencies": {
4-
"dgraph-js": "^2.0.1",
4+
"dgraph-js": "^2.0.2",
55
"grpc": "^1.23.3"
66
}
77
}

tests/integration/typeSystem.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ describe("Type system/directive", () => {
5757
age: int @index(int) .
5858
5959
type Person {
60-
name: string
61-
age: int
60+
name
61+
age
6262
}
6363
`);
6464

@@ -72,8 +72,8 @@ describe("Type system/directive", () => {
7272
age: int @index(int) .
7373
7474
type Person {
75-
name: string
76-
age: int
75+
name
76+
age
7777
}
7878
`);
7979

tests/integration/upsert.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ describe("upsert using doRequest", () => {
343343
when: int .
344344
345345
type Person {
346-
first: string
347-
last: string
348-
age: int
346+
first
347+
last
348+
age
349349
}
350350
`);
351351
await doUpserts();

0 commit comments

Comments
 (0)