File tree 1 file changed +57
-40
lines changed
1 file changed +57
-40
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ func ExampleTxn_Query_variables() {
87
87
name: string @index(exact) .
88
88
89
89
type Person {
90
- name: string
90
+ name
91
91
}
92
92
`
93
93
@@ -206,24 +206,24 @@ func ExampleTxn_Mutate() {
206
206
207
207
op := & api.Operation {}
208
208
op .Schema = `
209
+ name: string @index(exact) .
209
210
age: int .
210
211
married: bool .
212
+ Friends: [uid] .
213
+ loc: geo .
214
+ type: string .
215
+ coords: float .
211
216
212
217
type Person {
213
- name: string
214
- age: int
215
- married: bool
216
- Friends: [Person]
217
- loc: [Loc]
218
- }
219
-
220
- type Loc {
221
- type: string
222
- coords: float
223
- }
218
+ name
219
+ age
220
+ married
221
+ Friends
222
+ loc
223
+ }
224
224
225
225
type Institution {
226
- name: string
226
+ name
227
227
}
228
228
`
229
229
@@ -343,10 +343,11 @@ func ExampleTxn_Mutate_bytes() {
343
343
op := & api.Operation {}
344
344
op .Schema = `
345
345
name: string @index(exact) .
346
+ bytes: string .
346
347
347
348
type Person {
348
- name: string
349
- bytes: string
349
+ name
350
+ bytes
350
351
}
351
352
`
352
353
@@ -425,18 +426,20 @@ func ExampleTxn_Query_unmarshal() {
425
426
defer cancel ()
426
427
op := & api.Operation {}
427
428
op .Schema = `
429
+ name: string @index(exact) .
428
430
age: int .
429
431
married: bool .
432
+ Friends: [uid] .
430
433
431
434
type Person {
432
- name: string
433
- age: int
434
- married: bool
435
- Friends: [Person]
435
+ name
436
+ age
437
+ married
438
+ Friends
436
439
}
437
440
438
441
type Institution {
439
- name: string
442
+ name
440
443
}
441
444
`
442
445
@@ -612,23 +615,31 @@ func ExampleTxn_Mutate_facets() {
612
615
op = api.Operation {}
613
616
op .Schema = `
614
617
name: string @index(exact) .
618
+ age: int .
619
+ married: bool .
620
+ NameOrigin: string .
621
+ Since: string .
622
+ Family: string .
623
+ Age: bool .
624
+ Close: bool .
625
+ Friends: [uid] .
615
626
616
627
type Person {
617
- name: string
618
- age: int
619
- married: bool
620
- NameOrigin: string
621
- Since: string
622
- Family: string
623
- Age: int
624
- Close: bool
625
- Friends: [Person]
626
- }
628
+ name
629
+ age
630
+ married
631
+ NameOrigin
632
+ Since
633
+ Family
634
+ Age
635
+ Close
636
+ Friends
637
+ }
627
638
628
639
type Institution {
629
- name: string
630
- Since: string
631
- }
640
+ name
641
+ Since
642
+ }
632
643
`
633
644
634
645
err := dg .Alter (ctx , & op )
@@ -796,9 +807,9 @@ func ExampleTxn_Mutate_list() {
796
807
phone_number: [int] .
797
808
798
809
type Person {
799
- Address: [string]
800
- phone_number: [int]
801
- }
810
+ Address
811
+ phone_number
812
+ }
802
813
`
803
814
804
815
ctx := context .Background ()
@@ -863,10 +874,14 @@ func ExampleDeleteEdges() {
863
874
location: string .
864
875
865
876
type Person {
866
- name: string
867
- age: int
868
- married: bool
869
- Friends: [Person]
877
+ name
878
+ age
879
+ married
880
+ Friends
881
+ }
882
+
883
+ type Institution {
884
+ name
870
885
}
871
886
872
887
type Institution {
@@ -1212,8 +1227,10 @@ func ExampleTxn_Mutate_deletePredicate() {
1212
1227
1213
1228
op := & api.Operation {}
1214
1229
op .Schema = `
1230
+ name: string .
1215
1231
age: int .
1216
1232
married: bool .
1233
+ friends: [uid] .
1217
1234
1218
1235
type Person {
1219
1236
name: string
You can’t perform that action at this time.
0 commit comments