diff --git a/graphql/e2e/custom_logic/cmd/graphqlresponse.yaml b/graphql/e2e/custom_logic/cmd/graphqlresponse.yaml index 10d45e768e9..91ac57accd7 100644 --- a/graphql/e2e/custom_logic/cmd/graphqlresponse.yaml +++ b/graphql/e2e/custom_logic/cmd/graphqlresponse.yaml @@ -437,24 +437,6 @@ getPosts(input: [PostFilterInput]): [Post!] } -- name: getPostswithLike - schema: | - input PostFilterInput{ - id: ID! - text: String! - likes: Int - } - - type Post { - id: ID! - text: String - comments: Post! - } - - type Query{ - getPosts(input: [PostFilterInput]): [Post!] - } - - name: "carsschema" schema: | type Car { diff --git a/graphql/e2e/custom_logic/cmd/main.go b/graphql/e2e/custom_logic/cmd/main.go index 67c9d95185d..9981f546562 100644 --- a/graphql/e2e/custom_logic/cmd/main.go +++ b/graphql/e2e/custom_logic/cmd/main.go @@ -595,19 +595,6 @@ func getPosts(w http.ResponseWriter, r *http.Request) { check2(fmt.Fprint(w, generateIntrospectionResult(graphqlResponses["getPosts"].Schema))) } -func getPostswithLike(w http.ResponseWriter, r *http.Request) { - _, err := verifyGraphqlRequest(r, expectedGraphqlRequest{ - urlSuffix: "/getPostswithLike", - body: ``, - }) - if err != nil { - check2(w.Write([]byte(err.Error()))) - return - } - - check2(fmt.Fprint(w, generateIntrospectionResult(graphqlResponses["getPostswithLike"].Schema))) -} - type input struct { ID string `json:"uid"` } @@ -1229,7 +1216,6 @@ func main() { bsch := graphql.MustParseSchema(graphqlResponses["batchOperationSchema"].Schema, &query{}) bh := &relay.Handler{Schema: bsch} http.HandleFunc("/getPosts", getPosts) - http.HandleFunc("/getPostswithLike", getPostswithLike) http.Handle("/gqlUserNames", bh) http.Handle("/gqlCars", bh) http.HandleFunc("/gqlCarsWithErrors", gqlCarsWithErrorHandler) diff --git a/graphql/e2e/custom_logic/custom_logic_test.go b/graphql/e2e/custom_logic/custom_logic_test.go index ba3a8bbcb97..45845d93d90 100644 --- a/graphql/e2e/custom_logic/custom_logic_test.go +++ b/graphql/e2e/custom_logic/custom_logic_test.go @@ -2001,51 +2001,6 @@ func TestCustomGraphqlMissingTypeForBatchedFieldInput(t *testing.T) { "PostFilterInput.\n") } -func TestCustomGraphqlInvalidArgForBatchedField(t *testing.T) { - t.Skip() - schema := ` - type Post { - id: ID! - text: String - comments: Post! @custom(http: { - url: "http://mock:8888/getPosts", - method: "POST", - mode: BATCH - graphql: "query { getPosts(input: [{name: $id}]) }" - }) - } - ` - res := updateSchema(t, schema) - require.Equal(t, `{"updateGQLSchema":null}`, string(res.Data)) - require.Len(t, res.Errors, 1) - require.Equal(t, "resolving updateGQLSchema failed because input:9: Type Post"+ - "; Field comments: inside graphql in @custom directive, argument `name` is not present "+ - "in remote query `getPosts`.\n", res.Errors[0].Error()) -} - -func TestCustomGraphqlArgTypeMismatchForBatchedField(t *testing.T) { - t.Skip() - schema := ` - type Post { - id: ID! - likes: Int - text: String - comments: Post! @custom(http: { - url: "http://mock:8888/getPostswithLike", - method: "POST", - mode: BATCH - graphql: "query { getPosts(input: [{id: $id, text: $likes}]) }" - }) - } - ` - res := updateSchema(t, schema) - require.Equal(t, `{"updateGQLSchema":null}`, string(res.Data)) - require.Len(t, res.Errors, 1) - require.Equal(t, "resolving updateGQLSchema failed because input:10: Type Post"+ - "; Field comments: inside graphql in @custom directive, found type mismatch for variable"+ - " `$likes` in query `getPosts`, expected `Int`, got `String!`.\n", res.Errors[0].Error()) -} - func TestCustomGraphqlMissingRequiredArgument(t *testing.T) { schema := ` type Country @remote { @@ -2086,28 +2041,6 @@ func TestCustomGraphqlMissingRequiredArgument(t *testing.T) { " `setCountry` is missing, it is required by remote mutation.") } -func TestCustomGraphqlMissingRequiredArgumentForBatchedField(t *testing.T) { - t.Skip() - schema := ` - type Post { - id: ID! - text: String - comments: Post! @custom(http: { - url: "http://mock:8888/getPosts", - method: "POST", - mode: BATCH - graphql: "query { getPosts(input: [{id: $id}]) }" - }) - } - ` - res := updateSchema(t, schema) - require.Equal(t, `{"updateGQLSchema":null}`, string(res.Data)) - require.Len(t, res.Errors, 1) - require.Equal(t, "resolving updateGQLSchema failed because input:9: Type Post"+ - "; Field comments: inside graphql in @custom directive, argument `text` in query "+ - "`getPosts` is missing, it is required by remote query.\n", res.Errors[0].Error()) -} - // this one accepts an object and returns an object func TestCustomGraphqlMutation1(t *testing.T) { schema := ` @@ -2458,7 +2391,7 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) { result = params.ExecuteAsPost(t, alphaURL) common.RequireNoGQLErrors(t, result) - require.JSONEq(t, string(result.Data), ` + testutil.CompareJSON(t, ` { "querySearchTweets": [ { @@ -2479,5 +2412,5 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) { } } ] - }`) + }`, string(result.Data)) }