Skip to content

Commit

Permalink
Merge branch 'cleaning' of https://github.com/kmulvey/graphql into so…
Browse files Browse the repository at this point in the history
…gko/0.5.0
  • Loading branch information
sogko committed May 31, 2016
2 parents a241e1c + 0e4b18c commit 34413d2
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 264 deletions.
4 changes: 2 additions & 2 deletions abstract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func TestResolveTypeOnInterfaceYieldsUsefulError(t *testing.T) {
},
},
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
Locations: []location.SourceLocation{},
},
Expand Down Expand Up @@ -487,7 +487,7 @@ func TestResolveTypeOnUnionYieldsUsefulError(t *testing.T) {
},
},
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: `Runtime Object type "Human" is not a possible type for "Pet".`,
Locations: []location.SourceLocation{},
},
Expand Down
46 changes: 23 additions & 23 deletions definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,17 @@ func TestTypeSystem_DefinitionExample_StringifiesSimpleTypes(t *testing.T) {
expected string
}
tests := []Test{
Test{graphql.Int, "Int"},
Test{blogArticle, "Article"},
Test{interfaceType, "Interface"},
Test{unionType, "Union"},
Test{enumType, "Enum"},
Test{inputObjectType, "InputObject"},
Test{graphql.NewNonNull(graphql.Int), "Int!"},
Test{graphql.NewList(graphql.Int), "[Int]"},
Test{graphql.NewNonNull(graphql.NewList(graphql.Int)), "[Int]!"},
Test{graphql.NewList(graphql.NewNonNull(graphql.Int)), "[Int!]"},
Test{graphql.NewList(graphql.NewList(graphql.Int)), "[[Int]]"},
{graphql.Int, "Int"},
{blogArticle, "Article"},
{interfaceType, "Interface"},
{unionType, "Union"},
{enumType, "Enum"},
{inputObjectType, "InputObject"},
{graphql.NewNonNull(graphql.Int), "Int!"},
{graphql.NewList(graphql.Int), "[Int]"},
{graphql.NewNonNull(graphql.NewList(graphql.Int)), "[Int]!"},
{graphql.NewList(graphql.NewNonNull(graphql.Int)), "[Int!]"},
{graphql.NewList(graphql.NewList(graphql.Int)), "[[Int]]"},
}
for _, test := range tests {
ttypeStr := fmt.Sprintf("%v", test.ttype)
Expand All @@ -452,12 +452,12 @@ func TestTypeSystem_DefinitionExample_IdentifiesInputTypes(t *testing.T) {
expected bool
}
tests := []Test{
Test{graphql.Int, true},
Test{objectType, false},
Test{interfaceType, false},
Test{unionType, false},
Test{enumType, true},
Test{inputObjectType, true},
{graphql.Int, true},
{objectType, false},
{interfaceType, false},
{unionType, false},
{enumType, true},
{inputObjectType, true},
}
for _, test := range tests {
ttypeStr := fmt.Sprintf("%v", test.ttype)
Expand All @@ -479,12 +479,12 @@ func TestTypeSystem_DefinitionExample_IdentifiesOutputTypes(t *testing.T) {
expected bool
}
tests := []Test{
Test{graphql.Int, true},
Test{objectType, true},
Test{interfaceType, true},
Test{unionType, true},
Test{enumType, true},
Test{inputObjectType, false},
{graphql.Int, true},
{objectType, true},
{interfaceType, true},
{unionType, true},
{enumType, true},
{inputObjectType, false},
}
for _, test := range tests {
ttypeStr := fmt.Sprintf("%v", test.ttype)
Expand Down
12 changes: 6 additions & 6 deletions enum_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptStringLiterals(t *testing.T) {
expected := &graphql.Result{
Data: nil,
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "Argument \"fromEnum\" has invalid value \"GREEN\".\nExpected type \"Color\", found \"GREEN\".",
Locations: []location.SourceLocation{
{Line: 1, Column: 23},
Expand Down Expand Up @@ -208,7 +208,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueInPlaceOfEnumLiteral(t
expected := &graphql.Result{
Data: nil,
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "Argument \"fromEnum\" has invalid value 1.\nExpected type \"Color\", found 1.",
Locations: []location.SourceLocation{
{Line: 1, Column: 23},
Expand All @@ -227,7 +227,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptEnumLiteralInPlaceOfInt(t *testing.T
expected := &graphql.Result{
Data: nil,
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "Argument \"fromInt\" has invalid value GREEN.\nExpected type \"Int\", found GREEN.",
Locations: []location.SourceLocation{
{Line: 1, Column: 23},
Expand Down Expand Up @@ -296,7 +296,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueAsEnumVariable(t *testi
expected := &graphql.Result{
Data: nil,
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "Variable \"$color\" got invalid value 2.\nExpected type \"Color\", found \"2\".",
Locations: []location.SourceLocation{
{Line: 1, Column: 12},
Expand All @@ -317,7 +317,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptStringVariablesAsEnumInput(t *testin
expected := &graphql.Result{
Data: nil,
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: `Variable "$color" of type "String!" used in position expecting type "Color".`,
},
},
Expand All @@ -335,7 +335,7 @@ func TestTypeSystem_EnumValues_DoesNotAcceptInternalValueVariableAsEnumInput(t *
expected := &graphql.Result{
Data: nil,
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: `Variable "$color" of type "Int!" used in position expecting type "Color".`,
},
},
Expand Down
2 changes: 1 addition & 1 deletion executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ func defaultResolveFn(p ResolveParams) (interface{}, error) {
return nil, nil
}

// This method looks up the field on the given type defintion.
// This method looks up the field on the given type definition.
// It has special casing for the two introspection fields, __schema
// and __typename. __typename is special because it can always be
// queried as a field, even in situations where no other fields
Expand Down
14 changes: 7 additions & 7 deletions executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ func TestNullsOutErrorSubtrees(t *testing.T) {
"syncError": nil,
}
expectedErrors := []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "Error getting syncError",
Locations: []location.SourceLocation{
location.SourceLocation{
{
Line: 3, Column: 7,
},
},
Expand Down Expand Up @@ -714,7 +714,7 @@ func TestThrowsIfNoOperationIsProvided(t *testing.T) {
}

expectedErrors := []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "Must provide an operation.",
Locations: []location.SourceLocation{},
},
Expand Down Expand Up @@ -762,7 +762,7 @@ func TestThrowsIfNoOperationNameIsProvidedWithMultipleOperations(t *testing.T) {
}

expectedErrors := []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "Must provide operation name if query contains multiple operations.",
Locations: []location.SourceLocation{},
},
Expand Down Expand Up @@ -811,7 +811,7 @@ func TestThrowsIfUnknownOperationNameIsProvided(t *testing.T) {
}

expectedErrors := []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: `Unknown operation named "UnknownExample".`,
Locations: []location.SourceLocation{},
},
Expand Down Expand Up @@ -1302,7 +1302,7 @@ func TestFailsWhenAnIsTypeOfCheckIsNotMet(t *testing.T) {
},
},
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: `Expected value of type "SpecialType" but got: graphql_test.testNotSpecialType.`,
Locations: []location.SourceLocation{},
},
Expand Down Expand Up @@ -1371,7 +1371,7 @@ func TestFailsToExecuteQueryContainingATypeDefinition(t *testing.T) {
expected := &graphql.Result{
Data: nil,
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: "GraphQL cannot execute a request containing a ObjectDefinition",
Locations: []location.SourceLocation{},
},
Expand Down
4 changes: 2 additions & 2 deletions graphql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var Tests = []T{}

func init() {
Tests = []T{
T{
{
Query: `
query HeroNameQuery {
hero {
Expand All @@ -36,7 +36,7 @@ func init() {
},
},
},
T{
{
Query: `
query HeroNameAndFriendsQuery {
hero {
Expand Down
2 changes: 1 addition & 1 deletion introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func init() {
Type: typeType,
Description: "Request the type information of a single type.",
Args: []*Argument{
&Argument{
{
PrivateName: "name",
Type: NewNonNull(String),
},
Expand Down
4 changes: 2 additions & 2 deletions introspection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1301,11 +1301,11 @@ func TestIntrospection_FailsAsExpectedOnThe__TypeRootFieldWithoutAnArg(t *testin
`
expected := &graphql.Result{
Errors: []gqlerrors.FormattedError{
gqlerrors.FormattedError{
{
Message: `Field "__type" argument "name" of type "String!" ` +
`is required but not provided.`,
Locations: []location.SourceLocation{
location.SourceLocation{Line: 3, Column: 9},
{Line: 3, Column: 9},
},
},
},
Expand Down
Loading

0 comments on commit 34413d2

Please sign in to comment.