Skip to content

Commit 474a9cf

Browse files
committed
Merge pull request #68 from Fugiman/renames
Renamed exported structs and methods for better readability and usability.
2 parents 429dc37 + d770f8a commit 474a9cf

25 files changed

+782
-782
lines changed

abstract_test.go

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForInterface(t *testing.T) {
2828

2929
petType := graphql.NewInterface(graphql.InterfaceConfig{
3030
Name: "Pet",
31-
Fields: graphql.FieldConfigMap{
32-
"name": &graphql.FieldConfig{
31+
Fields: graphql.Fields{
32+
"name": &graphql.Field{
3333
Type: graphql.String,
3434
},
3535
},
@@ -45,19 +45,19 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForInterface(t *testing.T) {
4545
_, ok := value.(*testDog)
4646
return ok
4747
},
48-
Fields: graphql.FieldConfigMap{
49-
"name": &graphql.FieldConfig{
48+
Fields: graphql.Fields{
49+
"name": &graphql.Field{
5050
Type: graphql.String,
51-
Resolve: func(p graphql.GQLFRParams) interface{} {
51+
Resolve: func(p graphql.ResolveParams) interface{} {
5252
if dog, ok := p.Source.(*testDog); ok {
5353
return dog.Name
5454
}
5555
return nil
5656
},
5757
},
58-
"woofs": &graphql.FieldConfig{
58+
"woofs": &graphql.Field{
5959
Type: graphql.Boolean,
60-
Resolve: func(p graphql.GQLFRParams) interface{} {
60+
Resolve: func(p graphql.ResolveParams) interface{} {
6161
if dog, ok := p.Source.(*testDog); ok {
6262
return dog.Woofs
6363
}
@@ -76,19 +76,19 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForInterface(t *testing.T) {
7676
_, ok := value.(*testCat)
7777
return ok
7878
},
79-
Fields: graphql.FieldConfigMap{
80-
"name": &graphql.FieldConfig{
79+
Fields: graphql.Fields{
80+
"name": &graphql.Field{
8181
Type: graphql.String,
82-
Resolve: func(p graphql.GQLFRParams) interface{} {
82+
Resolve: func(p graphql.ResolveParams) interface{} {
8383
if cat, ok := p.Source.(*testCat); ok {
8484
return cat.Name
8585
}
8686
return nil
8787
},
8888
},
89-
"meows": &graphql.FieldConfig{
89+
"meows": &graphql.Field{
9090
Type: graphql.Boolean,
91-
Resolve: func(p graphql.GQLFRParams) interface{} {
91+
Resolve: func(p graphql.ResolveParams) interface{} {
9292
if cat, ok := p.Source.(*testCat); ok {
9393
return cat.Meows
9494
}
@@ -100,10 +100,10 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForInterface(t *testing.T) {
100100
schema, err := graphql.NewSchema(graphql.SchemaConfig{
101101
Query: graphql.NewObject(graphql.ObjectConfig{
102102
Name: "Query",
103-
Fields: graphql.FieldConfigMap{
104-
"pets": &graphql.FieldConfig{
103+
Fields: graphql.Fields{
104+
"pets": &graphql.Field{
105105
Type: graphql.NewList(petType),
106-
Resolve: func(p graphql.GQLFRParams) interface{} {
106+
Resolve: func(p graphql.ResolveParams) interface{} {
107107
return []interface{}{
108108
&testDog{"Odie", true},
109109
&testCat{"Garfield", false},
@@ -145,7 +145,7 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForInterface(t *testing.T) {
145145
Errors: nil,
146146
}
147147

148-
result := graphql.Graphql(graphql.Params{
148+
result := graphql.Do(graphql.Params{
149149
Schema: schema,
150150
RequestString: query,
151151
})
@@ -165,19 +165,19 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForUnion(t *testing.T) {
165165
_, ok := value.(*testDog)
166166
return ok
167167
},
168-
Fields: graphql.FieldConfigMap{
169-
"name": &graphql.FieldConfig{
168+
Fields: graphql.Fields{
169+
"name": &graphql.Field{
170170
Type: graphql.String,
171-
Resolve: func(p graphql.GQLFRParams) interface{} {
171+
Resolve: func(p graphql.ResolveParams) interface{} {
172172
if dog, ok := p.Source.(*testDog); ok {
173173
return dog.Name
174174
}
175175
return nil
176176
},
177177
},
178-
"woofs": &graphql.FieldConfig{
178+
"woofs": &graphql.Field{
179179
Type: graphql.Boolean,
180-
Resolve: func(p graphql.GQLFRParams) interface{} {
180+
Resolve: func(p graphql.ResolveParams) interface{} {
181181
if dog, ok := p.Source.(*testDog); ok {
182182
return dog.Woofs
183183
}
@@ -192,19 +192,19 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForUnion(t *testing.T) {
192192
_, ok := value.(*testCat)
193193
return ok
194194
},
195-
Fields: graphql.FieldConfigMap{
196-
"name": &graphql.FieldConfig{
195+
Fields: graphql.Fields{
196+
"name": &graphql.Field{
197197
Type: graphql.String,
198-
Resolve: func(p graphql.GQLFRParams) interface{} {
198+
Resolve: func(p graphql.ResolveParams) interface{} {
199199
if cat, ok := p.Source.(*testCat); ok {
200200
return cat.Name
201201
}
202202
return nil
203203
},
204204
},
205-
"meows": &graphql.FieldConfig{
205+
"meows": &graphql.Field{
206206
Type: graphql.Boolean,
207-
Resolve: func(p graphql.GQLFRParams) interface{} {
207+
Resolve: func(p graphql.ResolveParams) interface{} {
208208
if cat, ok := p.Source.(*testCat); ok {
209209
return cat.Meows
210210
}
@@ -232,10 +232,10 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForUnion(t *testing.T) {
232232
schema, err := graphql.NewSchema(graphql.SchemaConfig{
233233
Query: graphql.NewObject(graphql.ObjectConfig{
234234
Name: "Query",
235-
Fields: graphql.FieldConfigMap{
236-
"pets": &graphql.FieldConfig{
235+
Fields: graphql.Fields{
236+
"pets": &graphql.Field{
237237
Type: graphql.NewList(petType),
238-
Resolve: func(p graphql.GQLFRParams) interface{} {
238+
Resolve: func(p graphql.ResolveParams) interface{} {
239239
return []interface{}{
240240
&testDog{"Odie", true},
241241
&testCat{"Garfield", false},
@@ -277,7 +277,7 @@ func TestIsTypeOfUsedToResolveRuntimeTypeForUnion(t *testing.T) {
277277
Errors: nil,
278278
}
279279

280-
result := graphql.Graphql(graphql.Params{
280+
result := graphql.Do(graphql.Params{
281281
Schema: schema,
282282
RequestString: query,
283283
})
@@ -297,8 +297,8 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
297297
var humanType *graphql.Object
298298
petType := graphql.NewInterface(graphql.InterfaceConfig{
299299
Name: "Pet",
300-
Fields: graphql.FieldConfigMap{
301-
"name": &graphql.FieldConfig{
300+
Fields: graphql.Fields{
301+
"name": &graphql.Field{
302302
Type: graphql.String,
303303
},
304304
},
@@ -318,10 +318,10 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
318318

319319
humanType = graphql.NewObject(graphql.ObjectConfig{
320320
Name: "Human",
321-
Fields: graphql.FieldConfigMap{
322-
"name": &graphql.FieldConfig{
321+
Fields: graphql.Fields{
322+
"name": &graphql.Field{
323323
Type: graphql.String,
324-
Resolve: func(p graphql.GQLFRParams) interface{} {
324+
Resolve: func(p graphql.ResolveParams) interface{} {
325325
if human, ok := p.Source.(*testHuman); ok {
326326
return human.Name
327327
}
@@ -339,19 +339,19 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
339339
_, ok := value.(*testDog)
340340
return ok
341341
},
342-
Fields: graphql.FieldConfigMap{
343-
"name": &graphql.FieldConfig{
342+
Fields: graphql.Fields{
343+
"name": &graphql.Field{
344344
Type: graphql.String,
345-
Resolve: func(p graphql.GQLFRParams) interface{} {
345+
Resolve: func(p graphql.ResolveParams) interface{} {
346346
if dog, ok := p.Source.(*testDog); ok {
347347
return dog.Name
348348
}
349349
return nil
350350
},
351351
},
352-
"woofs": &graphql.FieldConfig{
352+
"woofs": &graphql.Field{
353353
Type: graphql.Boolean,
354-
Resolve: func(p graphql.GQLFRParams) interface{} {
354+
Resolve: func(p graphql.ResolveParams) interface{} {
355355
if dog, ok := p.Source.(*testDog); ok {
356356
return dog.Woofs
357357
}
@@ -369,19 +369,19 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
369369
_, ok := value.(*testCat)
370370
return ok
371371
},
372-
Fields: graphql.FieldConfigMap{
373-
"name": &graphql.FieldConfig{
372+
Fields: graphql.Fields{
373+
"name": &graphql.Field{
374374
Type: graphql.String,
375-
Resolve: func(p graphql.GQLFRParams) interface{} {
375+
Resolve: func(p graphql.ResolveParams) interface{} {
376376
if cat, ok := p.Source.(*testCat); ok {
377377
return cat.Name
378378
}
379379
return nil
380380
},
381381
},
382-
"meows": &graphql.FieldConfig{
382+
"meows": &graphql.Field{
383383
Type: graphql.Boolean,
384-
Resolve: func(p graphql.GQLFRParams) interface{} {
384+
Resolve: func(p graphql.ResolveParams) interface{} {
385385
if cat, ok := p.Source.(*testCat); ok {
386386
return cat.Meows
387387
}
@@ -393,10 +393,10 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
393393
schema, err := graphql.NewSchema(graphql.SchemaConfig{
394394
Query: graphql.NewObject(graphql.ObjectConfig{
395395
Name: "Query",
396-
Fields: graphql.FieldConfigMap{
397-
"pets": &graphql.FieldConfig{
396+
Fields: graphql.Fields{
397+
"pets": &graphql.Field{
398398
Type: graphql.NewList(petType),
399-
Resolve: func(p graphql.GQLFRParams) interface{} {
399+
Resolve: func(p graphql.ResolveParams) interface{} {
400400
return []interface{}{
401401
&testDog{"Odie", true},
402402
&testCat{"Garfield", false},
@@ -445,7 +445,7 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
445445
},
446446
}
447447

448-
result := graphql.Graphql(graphql.Params{
448+
result := graphql.Do(graphql.Params{
449449
Schema: schema,
450450
RequestString: query,
451451
})
@@ -461,10 +461,10 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
461461

462462
humanType := graphql.NewObject(graphql.ObjectConfig{
463463
Name: "Human",
464-
Fields: graphql.FieldConfigMap{
465-
"name": &graphql.FieldConfig{
464+
Fields: graphql.Fields{
465+
"name": &graphql.Field{
466466
Type: graphql.String,
467-
Resolve: func(p graphql.GQLFRParams) interface{} {
467+
Resolve: func(p graphql.ResolveParams) interface{} {
468468
if human, ok := p.Source.(*testHuman); ok {
469469
return human.Name
470470
}
@@ -479,19 +479,19 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
479479
_, ok := value.(*testDog)
480480
return ok
481481
},
482-
Fields: graphql.FieldConfigMap{
483-
"name": &graphql.FieldConfig{
482+
Fields: graphql.Fields{
483+
"name": &graphql.Field{
484484
Type: graphql.String,
485-
Resolve: func(p graphql.GQLFRParams) interface{} {
485+
Resolve: func(p graphql.ResolveParams) interface{} {
486486
if dog, ok := p.Source.(*testDog); ok {
487487
return dog.Name
488488
}
489489
return nil
490490
},
491491
},
492-
"woofs": &graphql.FieldConfig{
492+
"woofs": &graphql.Field{
493493
Type: graphql.Boolean,
494-
Resolve: func(p graphql.GQLFRParams) interface{} {
494+
Resolve: func(p graphql.ResolveParams) interface{} {
495495
if dog, ok := p.Source.(*testDog); ok {
496496
return dog.Woofs
497497
}
@@ -506,19 +506,19 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
506506
_, ok := value.(*testCat)
507507
return ok
508508
},
509-
Fields: graphql.FieldConfigMap{
510-
"name": &graphql.FieldConfig{
509+
Fields: graphql.Fields{
510+
"name": &graphql.Field{
511511
Type: graphql.String,
512-
Resolve: func(p graphql.GQLFRParams) interface{} {
512+
Resolve: func(p graphql.ResolveParams) interface{} {
513513
if cat, ok := p.Source.(*testCat); ok {
514514
return cat.Name
515515
}
516516
return nil
517517
},
518518
},
519-
"meows": &graphql.FieldConfig{
519+
"meows": &graphql.Field{
520520
Type: graphql.Boolean,
521-
Resolve: func(p graphql.GQLFRParams) interface{} {
521+
Resolve: func(p graphql.ResolveParams) interface{} {
522522
if cat, ok := p.Source.(*testCat); ok {
523523
return cat.Meows
524524
}
@@ -548,10 +548,10 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
548548
schema, err := graphql.NewSchema(graphql.SchemaConfig{
549549
Query: graphql.NewObject(graphql.ObjectConfig{
550550
Name: "Query",
551-
Fields: graphql.FieldConfigMap{
552-
"pets": &graphql.FieldConfig{
551+
Fields: graphql.Fields{
552+
"pets": &graphql.Field{
553553
Type: graphql.NewList(petType),
554-
Resolve: func(p graphql.GQLFRParams) interface{} {
554+
Resolve: func(p graphql.ResolveParams) interface{} {
555555
return []interface{}{
556556
&testDog{"Odie", true},
557557
&testCat{"Garfield", false},
@@ -600,7 +600,7 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
600600
},
601601
}
602602

603-
result := graphql.Graphql(graphql.Params{
603+
result := graphql.Do(graphql.Params{
604604
Schema: schema,
605605
RequestString: query,
606606
})

0 commit comments

Comments
 (0)