Skip to content

Commit 34413d2

Browse files
committed
Merge branch 'cleaning' of https://github.com/kmulvey/graphql into sogko/0.5.0
2 parents a241e1c + 0e4b18c commit 34413d2

15 files changed

+264
-264
lines changed

abstract_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
369369
},
370370
},
371371
Errors: []gqlerrors.FormattedError{
372-
gqlerrors.FormattedError{
372+
{
373373
Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
374374
Locations: []location.SourceLocation{},
375375
},
@@ -487,7 +487,7 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
487487
},
488488
},
489489
Errors: []gqlerrors.FormattedError{
490-
gqlerrors.FormattedError{
490+
{
491491
Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
492492
Locations: []location.SourceLocation{},
493493
},

definition_test.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,17 @@ func TestTypeSystem_DefinitionExample_StringifiesSimpleTypes(t *testing.T) {
426426
expected string
427427
}
428428
tests := []Test{
429-
Test{graphql.Int, "Int"},
430-
Test{blogArticle, "Article"},
431-
Test{interfaceType, "Interface"},
432-
Test{unionType, "Union"},
433-
Test{enumType, "Enum"},
434-
Test{inputObjectType, "InputObject"},
435-
Test{graphql.NewNonNull(graphql.Int), "Int!"},
436-
Test{graphql.NewList(graphql.Int), "[Int]"},
437-
Test{graphql.NewNonNull(graphql.NewList(graphql.Int)), "[Int]!"},
438-
Test{graphql.NewList(graphql.NewNonNull(graphql.Int)), "[Int!]"},
439-
Test{graphql.NewList(graphql.NewList(graphql.Int)), "[[Int]]"},
429+
{graphql.Int, "Int"},
430+
{blogArticle, "Article"},
431+
{interfaceType, "Interface"},
432+
{unionType, "Union"},
433+
{enumType, "Enum"},
434+
{inputObjectType, "InputObject"},
435+
{graphql.NewNonNull(graphql.Int), "Int!"},
436+
{graphql.NewList(graphql.Int), "[Int]"},
437+
{graphql.NewNonNull(graphql.NewList(graphql.Int)), "[Int]!"},
438+
{graphql.NewList(graphql.NewNonNull(graphql.Int)), "[Int!]"},
439+
{graphql.NewList(graphql.NewList(graphql.Int)), "[[Int]]"},
440440
}
441441
for _, test := range tests {
442442
ttypeStr := fmt.Sprintf("%v", test.ttype)
@@ -452,12 +452,12 @@ func TestTypeSystem_DefinitionExample_IdentifiesInputTypes(t *testing.T) {
452452
expected bool
453453
}
454454
tests := []Test{
455-
Test{graphql.Int, true},
456-
Test{objectType, false},
457-
Test{interfaceType, false},
458-
Test{unionType, false},
459-
Test{enumType, true},
460-
Test{inputObjectType, true},
455+
{graphql.Int, true},
456+
{objectType, false},
457+
{interfaceType, false},
458+
{unionType, false},
459+
{enumType, true},
460+
{inputObjectType, true},
461461
}
462462
for _, test := range tests {
463463
ttypeStr := fmt.Sprintf("%v", test.ttype)
@@ -479,12 +479,12 @@ func TestTypeSystem_DefinitionExample_IdentifiesOutputTypes(t *testing.T) {
479479
expected bool
480480
}
481481
tests := []Test{
482-
Test{graphql.Int, true},
483-
Test{objectType, true},
484-
Test{interfaceType, true},
485-
Test{unionType, true},
486-
Test{enumType, true},
487-
Test{inputObjectType, false},
482+
{graphql.Int, true},
483+
{objectType, true},
484+
{interfaceType, true},
485+
{unionType, true},
486+
{enumType, true},
487+
{inputObjectType, false},
488488
}
489489
for _, test := range tests {
490490
ttypeStr := fmt.Sprintf("%v", test.ttype)

enum_type_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptStringLiterals(t *testing.T) {
178178
expected := &graphql.Result{
179179
Data: nil,
180180
Errors: []gqlerrors.FormattedError{
181-
gqlerrors.FormattedError{
181+
{
182182
Message: "Argument \"fromEnum\" has invalid value \"GREEN\".\nExpected type \"Color\", found \"GREEN\".",
183183
Locations: []location.SourceLocation{
184184
{Line: 1, Column: 23},
@@ -208,7 +208,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueInPlaceOfEnumLiteral(t
208208
expected := &graphql.Result{
209209
Data: nil,
210210
Errors: []gqlerrors.FormattedError{
211-
gqlerrors.FormattedError{
211+
{
212212
Message: "Argument \"fromEnum\" has invalid value 1.\nExpected type \"Color\", found 1.",
213213
Locations: []location.SourceLocation{
214214
{Line: 1, Column: 23},
@@ -227,7 +227,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptEnumLiteralInPlaceOfInt(t *testing.T
227227
expected := &graphql.Result{
228228
Data: nil,
229229
Errors: []gqlerrors.FormattedError{
230-
gqlerrors.FormattedError{
230+
{
231231
Message: "Argument \"fromInt\" has invalid value GREEN.\nExpected type \"Int\", found GREEN.",
232232
Locations: []location.SourceLocation{
233233
{Line: 1, Column: 23},
@@ -296,7 +296,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueAsEnumVariable(t *testi
296296
expected := &graphql.Result{
297297
Data: nil,
298298
Errors: []gqlerrors.FormattedError{
299-
gqlerrors.FormattedError{
299+
{
300300
Message: "Variable \"$color\" got invalid value 2.\nExpected type \"Color\", found \"2\".",
301301
Locations: []location.SourceLocation{
302302
{Line: 1, Column: 12},
@@ -317,7 +317,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptStringVariablesAsEnumInput(t *testin
317317
expected := &graphql.Result{
318318
Data: nil,
319319
Errors: []gqlerrors.FormattedError{
320-
gqlerrors.FormattedError{
320+
{
321321
Message: `Variable "$color" of type "String!" used in position expecting type "Color".`,
322322
},
323323
},
@@ -335,7 +335,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueVariableAsEnumInput(t *
335335
expected := &graphql.Result{
336336
Data: nil,
337337
Errors: []gqlerrors.FormattedError{
338-
gqlerrors.FormattedError{
338+
{
339339
Message: `Variable "$color" of type "Int!" used in position expecting type "Color".`,
340340
},
341341
},

executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ func defaultResolveFn(p ResolveParams) (interface{}, error) {
843843
return nil, nil
844844
}
845845

846-
// This method looks up the field on the given type defintion.
846+
// This method looks up the field on the given type definition.
847847
// It has special casing for the two introspection fields, __schema
848848
// and __typename. __typename is special because it can always be
849849
// queried as a field, even in situations where no other fields

executor_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,10 @@ func TestNullsOutErrorSubtrees(t *testing.T) {
515515
"syncError": nil,
516516
}
517517
expectedErrors := []gqlerrors.FormattedError{
518-
gqlerrors.FormattedError{
518+
{
519519
Message: "Error getting syncError",
520520
Locations: []location.SourceLocation{
521-
location.SourceLocation{
521+
{
522522
Line: 3, Column: 7,
523523
},
524524
},
@@ -714,7 +714,7 @@ func TestThrowsIfNoOperationIsProvided(t *testing.T) {
714714
}
715715

716716
expectedErrors := []gqlerrors.FormattedError{
717-
gqlerrors.FormattedError{
717+
{
718718
Message: "Must provide an operation.",
719719
Locations: []location.SourceLocation{},
720720
},
@@ -762,7 +762,7 @@ func TestThrowsIfNoOperationNameIsProvidedWithMultipleOperations(t *testing.T) {
762762
}
763763

764764
expectedErrors := []gqlerrors.FormattedError{
765-
gqlerrors.FormattedError{
765+
{
766766
Message: "Must provide operation name if query contains multiple operations.",
767767
Locations: []location.SourceLocation{},
768768
},
@@ -811,7 +811,7 @@ func TestThrowsIfUnknownOperationNameIsProvided(t *testing.T) {
811811
}
812812

813813
expectedErrors := []gqlerrors.FormattedError{
814-
gqlerrors.FormattedError{
814+
{
815815
Message: `Unknown operation named "UnknownExample".`,
816816
Locations: []location.SourceLocation{},
817817
},
@@ -1302,7 +1302,7 @@ func TestFailsWhenAnIsTypeOfCheckIsNotMet(t *testing.T) {
13021302
},
13031303
},
13041304
Errors: []gqlerrors.FormattedError{
1305-
gqlerrors.FormattedError{
1305+
{
13061306
Message: `Expected value of type "SpecialType" but got: graphql_test.testNotSpecialType.`,
13071307
Locations: []location.SourceLocation{},
13081308
},
@@ -1371,7 +1371,7 @@ func TestFailsToExecuteQueryContainingATypeDefinition(t *testing.T) {
13711371
expected := &graphql.Result{
13721372
Data: nil,
13731373
Errors: []gqlerrors.FormattedError{
1374-
gqlerrors.FormattedError{
1374+
{
13751375
Message: "GraphQL cannot execute a request containing a ObjectDefinition",
13761376
Locations: []location.SourceLocation{},
13771377
},

graphql_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var Tests = []T{}
1919

2020
func init() {
2121
Tests = []T{
22-
T{
22+
{
2323
Query: `
2424
query HeroNameQuery {
2525
hero {
@@ -36,7 +36,7 @@ func init() {
3636
},
3737
},
3838
},
39-
T{
39+
{
4040
Query: `
4141
query HeroNameAndFriendsQuery {
4242
hero {

introspection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ func init() {
559559
Type: typeType,
560560
Description: "Request the type information of a single type.",
561561
Args: []*Argument{
562-
&Argument{
562+
{
563563
PrivateName: "name",
564564
Type: NewNonNull(String),
565565
},

introspection_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,11 +1301,11 @@ func TestIntrospection_FailsAsExpectedOnThe__TypeRootFieldWithoutAnArg(t *testin
13011301
`
13021302
expected := &graphql.Result{
13031303
Errors: []gqlerrors.FormattedError{
1304-
gqlerrors.FormattedError{
1304+
{
13051305
Message: `Field "__type" argument "name" of type "String!" ` +
13061306
`is required but not provided.`,
13071307
Locations: []location.SourceLocation{
1308-
location.SourceLocation{Line: 3, Column: 9},
1308+
{Line: 3, Column: 9},
13091309
},
13101310
},
13111311
},

0 commit comments

Comments
 (0)