@@ -2001,51 +2001,6 @@ func TestCustomGraphqlMissingTypeForBatchedFieldInput(t *testing.T) {
2001
2001
"PostFilterInput.\n " )
2002
2002
}
2003
2003
2004
- func TestCustomGraphqlInvalidArgForBatchedField (t * testing.T ) {
2005
- t .Skip ()
2006
- schema := `
2007
- type Post {
2008
- id: ID!
2009
- text: String
2010
- comments: Post! @custom(http: {
2011
- url: "http://mock:8888/getPosts",
2012
- method: "POST",
2013
- mode: BATCH
2014
- graphql: "query { getPosts(input: [{name: $id}]) }"
2015
- })
2016
- }
2017
- `
2018
- res := updateSchema (t , schema )
2019
- require .Equal (t , `{"updateGQLSchema":null}` , string (res .Data ))
2020
- require .Len (t , res .Errors , 1 )
2021
- require .Equal (t , "resolving updateGQLSchema failed because input:9: Type Post" +
2022
- "; Field comments: inside graphql in @custom directive, argument `name` is not present " +
2023
- "in remote query `getPosts`.\n " , res .Errors [0 ].Error ())
2024
- }
2025
-
2026
- func TestCustomGraphqlArgTypeMismatchForBatchedField (t * testing.T ) {
2027
- t .Skip ()
2028
- schema := `
2029
- type Post {
2030
- id: ID!
2031
- likes: Int
2032
- text: String
2033
- comments: Post! @custom(http: {
2034
- url: "http://mock:8888/getPostswithLike",
2035
- method: "POST",
2036
- mode: BATCH
2037
- graphql: "query { getPosts(input: [{id: $id, text: $likes}]) }"
2038
- })
2039
- }
2040
- `
2041
- res := updateSchema (t , schema )
2042
- require .Equal (t , `{"updateGQLSchema":null}` , string (res .Data ))
2043
- require .Len (t , res .Errors , 1 )
2044
- require .Equal (t , "resolving updateGQLSchema failed because input:10: Type Post" +
2045
- "; Field comments: inside graphql in @custom directive, found type mismatch for variable" +
2046
- " `$likes` in query `getPosts`, expected `Int`, got `String!`.\n " , res .Errors [0 ].Error ())
2047
- }
2048
-
2049
2004
func TestCustomGraphqlMissingRequiredArgument (t * testing.T ) {
2050
2005
schema := `
2051
2006
type Country @remote {
@@ -2086,28 +2041,6 @@ func TestCustomGraphqlMissingRequiredArgument(t *testing.T) {
2086
2041
" `setCountry` is missing, it is required by remote mutation." )
2087
2042
}
2088
2043
2089
- func TestCustomGraphqlMissingRequiredArgumentForBatchedField (t * testing.T ) {
2090
- t .Skip ()
2091
- schema := `
2092
- type Post {
2093
- id: ID!
2094
- text: String
2095
- comments: Post! @custom(http: {
2096
- url: "http://mock:8888/getPosts",
2097
- method: "POST",
2098
- mode: BATCH
2099
- graphql: "query { getPosts(input: [{id: $id}]) }"
2100
- })
2101
- }
2102
- `
2103
- res := updateSchema (t , schema )
2104
- require .Equal (t , `{"updateGQLSchema":null}` , string (res .Data ))
2105
- require .Len (t , res .Errors , 1 )
2106
- require .Equal (t , "resolving updateGQLSchema failed because input:9: Type Post" +
2107
- "; Field comments: inside graphql in @custom directive, argument `text` in query " +
2108
- "`getPosts` is missing, it is required by remote query.\n " , res .Errors [0 ].Error ())
2109
- }
2110
-
2111
2044
// this one accepts an object and returns an object
2112
2045
func TestCustomGraphqlMutation1 (t * testing.T ) {
2113
2046
schema := `
@@ -2458,7 +2391,7 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) {
2458
2391
2459
2392
result = params .ExecuteAsPost (t , alphaURL )
2460
2393
common .RequireNoGQLErrors (t , result )
2461
- require . JSONEq ( t , string ( result . Data ) , `
2394
+ testutil . CompareJSON ( t , `
2462
2395
{
2463
2396
"querySearchTweets": [
2464
2397
{
@@ -2479,5 +2412,5 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) {
2479
2412
}
2480
2413
}
2481
2414
]
2482
- }` )
2415
+ }` , string ( result . Data ) )
2483
2416
}
0 commit comments