Skip to content

Commit

Permalink
chore(linter): fix files to limit line width to 120 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 committed Feb 13, 2023
1 parent f893f96 commit d7484b1
Show file tree
Hide file tree
Showing 35 changed files with 297 additions and 123 deletions.
3 changes: 2 additions & 1 deletion chunker/json_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ func TestJsonNumberParsing(t *testing.T) {
out *api.Value
}{
{`{"uid": "1", "key": 9223372036854775299}`, &api.Value{Val: &api.Value_IntVal{IntVal: 9223372036854775299}}},
{`{"uid": "1", "key": 9223372036854775299.0}`, &api.Value{Val: &api.Value_DoubleVal{DoubleVal: 9223372036854775299.0}}},
{`{"uid": "1", "key": 9223372036854775299.0}`,
&api.Value{Val: &api.Value_DoubleVal{DoubleVal: 9223372036854775299.0}}},
{`{"uid": "1", "key": 27670116110564327426}`, nil},
{`{"uid": "1", "key": "23452786"}`, &api.Value{Val: &api.Value_StrVal{StrVal: "23452786"}}},
{`{"uid": "1", "key": "23452786.2378"}`, &api.Value{Val: &api.Value_StrVal{StrVal: "23452786.2378"}}},
Expand Down
3 changes: 2 additions & 1 deletion contrib/integration/bank/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ func (s *state) runTransaction(dg *dgo.Dgraph, buf *bytes.Buffer) error {
return err
}
if len(assigned.GetUids()) > 0 {
fmt.Fprintf(w, "[StartTs: %v] CREATED K_%02d: %+v for %+v\n", assigned.Txn.StartTs, dst.Key, assigned.GetUids(), dst)
fmt.Fprintf(w, "[StartTs: %v] CREATED K_%02d: %+v for %+v\n", assigned.Txn.StartTs,
dst.Key, assigned.GetUids(), dst)
for _, uid := range assigned.GetUids() {
dst.Uid = uid
}
Expand Down
10 changes: 6 additions & 4 deletions dgraph/cmd/alpha/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ func TestDeletePredicate(t *testing.T) {
output, err = runGraphqlQuery(`schema{}`)
require.NoError(t, err)

testutil.CompareJSON(t, testutil.GetFullSchemaHTTPResponse(testutil.SchemaOptions{UserPreds: `{"predicate":"age","type":"default"},` +
`{"predicate":"name","type":"string","index":true, "tokenizer":["term"]}`}),
output)
testutil.CompareJSON(t, testutil.GetFullSchemaHTTPResponse(testutil.SchemaOptions{
UserPreds: `{"predicate":"age","type":"default"},` +
`{"predicate":"name","type":"string","index":true, "tokenizer":["term"]}`}), output)

output, err = runGraphqlQuery(q1)
require.NoError(t, err)
Expand Down Expand Up @@ -1142,7 +1142,9 @@ func TestDeleteAllSP2(t *testing.T) {

output, err := runGraphqlQuery(q)
require.NoError(t, err)
require.JSONEq(t, `{"data": {"me":[{"name":"July 3 2017","date":"2017-07-03T03:49:03Z","weight":262.3,"lifeLoad":5,"stressLevel":3}]}}`, output)
require.JSONEq(t,
`{"data": {"me":[{"name":"July 3 2017","date":"2017-07-03T03:49:03Z",`+
`"weight":262.3,"lifeLoad":5,"stressLevel":3}]}}`, output)

m = fmt.Sprintf(`
{
Expand Down
18 changes: 13 additions & 5 deletions dql/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,8 @@ func TestParseFilter_opNot2(t *testing.T) {
require.NotNil(t, res.Query[0])
require.Equal(t, []string{"friends", "gender", "age", "hometown"}, childAttrs(res.Query[0]))
require.Equal(t, []string{"name"}, childAttrs(res.Query[0].Children[0]))
require.Equal(t, `(AND (NOT (OR (a aa "aaa") (b bb "bbb"))) (c cc "ccc"))`, res.Query[0].Children[0].Filter.debugString())
require.Equal(t, `(AND (NOT (OR (a aa "aaa") (b bb "bbb"))) (c cc "ccc"))`,
res.Query[0].Children[0].Filter.debugString())
}

// Test operator precedence. Let brackets make or evaluates before and.
Expand Down Expand Up @@ -2421,9 +2422,11 @@ func TestParseFilter_brac(t *testing.T) {
require.NotNil(t, res.Query[0])
require.Equal(t, []string{"friends", "gender", "age", "hometown"}, childAttrs(res.Query[0]))
require.Equal(t, []string{"name"}, childAttrs(res.Query[0].Children[0]))
require.Equal(t,
require.Equal(
t,
`(OR (a name "hello") (AND (AND (b name "world" "is") (OR (c aa "aaa") (OR (d dd "haha") (e ee "aaa")))) (f ff "aaa")))`,
res.Query[0].Children[0].Filter.debugString())
res.Query[0].Children[0].Filter.debugString(),
)
}

// Test if unbalanced brac will lead to errors.
Expand Down Expand Up @@ -2479,7 +2482,11 @@ func TestParseFilter_Geo2(t *testing.T) {
`
resp, err := Parse(Request{Str: query})
require.NoError(t, err)
require.Equal(t, "[[11.2,-2.234],[-31.23,4.3214],[5.312,6.53]]", resp.Query[0].Children[0].Filter.Func.Args[0].Value)
require.Equal(
t,
"[[11.2,-2.234],[-31.23,4.3214],[5.312,6.53]]",
resp.Query[0].Children[0].Filter.Func.Args[0].Value,
)
}

func TestParseFilter_Geo3(t *testing.T) {
Expand Down Expand Up @@ -4234,7 +4241,8 @@ func TestParserFuzz(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
defer func() {
if r := recover(); r != nil {
t.Errorf("parser panic caused by test: '%s', input: '%s': %v\n%s", test.name, test.in, r, debug.Stack())
t.Errorf("parser panic caused by test: '%s', input: '%s': %v\n%s", test.name,
test.in, r, debug.Stack())
}
}()

Expand Down
4 changes: 3 additions & 1 deletion edgraph/access_ee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ func TestValidateToken(t *testing.T) {
tokenString := generateJWT(userdata.namespace, userdata.userId, userdata.groupIds, expiry)
ud, err := validateToken(tokenString)
require.Nil(t, err)
if ud.namespace != userdata.namespace || ud.userId != userdata.userId || !sliceCompare(ud.groupIds, userdata.groupIds) {
if ud.namespace != userdata.namespace || ud.userId != userdata.userId ||
!sliceCompare(ud.groupIds, userdata.groupIds) {

t.Errorf("Actual output %+v is not equal to the expected output %+v", userdata, ud)
}
}
Expand Down
26 changes: 13 additions & 13 deletions edgraph/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ func TestValidateKeys(t *testing.T) {
nquad string
noError bool
}{
{name: "test 1", nquad: `_:alice <knows> "stuff" ( "key 1" = 12 ) .`, noError: false},
{name: "test 2", nquad: `_:alice <knows> "stuff" ( "key 1" = 12 ) .`, noError: false},
{name: "test 3", nquad: `_:alice <knows> "stuff" ( ~key1 = 12 ) .`, noError: false},
{name: "test 4", nquad: `_:alice <knows> "stuff" ( "~key1" = 12 ) .`, noError: false},
{name: "test 5", nquad: `_:alice <~knows> "stuff" ( "key 1" = 12 ) .`, noError: false},
{name: "test 6", nquad: `_:alice <~knows> "stuff" ( "key 1" = 12 ) .`, noError: false},
{name: "test 7", nquad: `_:alice <~knows> "stuff" ( key1 = 12 ) .`, noError: false},
{name: "test 8", nquad: `_:alice <~knows> "stuff" ( "key1" = 12 ) .`, noError: false},
{name: "test 9", nquad: `_:alice <~knows> "stuff" ( "key 1" = 12 ) .`, noError: false},
{name: "test 10", nquad: `_:alice <knows> "stuff" ( key1 = 12 , "key 2" = 13 ) .`, noError: false},
{name: "test 11", nquad: `_:alice <knows> "stuff" ( "key1" = 12, key2 = 13 , "key 3" = "a b" ) .`, noError: false},
{name: "test 12", nquad: `_:alice <knows~> "stuff" ( key1 = 12 ) .`, noError: false},
{name: "test 1", nquad: `_:alice <knows> "stuff" ( "key 1" = 12 ) .`},
{name: "test 2", nquad: `_:alice <knows> "stuff" ( "key 1" = 12 ) .`},
{name: "test 3", nquad: `_:alice <knows> "stuff" ( ~key1 = 12 ) .`},
{name: "test 4", nquad: `_:alice <knows> "stuff" ( "~key1" = 12 ) .`},
{name: "test 5", nquad: `_:alice <~knows> "stuff" ( "key 1" = 12 ) .`},
{name: "test 6", nquad: `_:alice <~knows> "stuff" ( "key 1" = 12 ) .`},
{name: "test 7", nquad: `_:alice <~knows> "stuff" ( key1 = 12 ) .`},
{name: "test 8", nquad: `_:alice <~knows> "stuff" ( "key1" = 12 ) .`},
{name: "test 9", nquad: `_:alice <~knows> "stuff" ( "key 1" = 12 ) .`},
{name: "test 10", nquad: `_:alice <knows> "stuff" ( key1 = 12 , "key 2" = 13 ) .`},
{name: "test 11", nquad: `_:alice <knows> "stuff" ( "key1" = 12, key2 = 13 , "key 3" = "a b" ) .`},
{name: "test 12", nquad: `_:alice <knows~> "stuff" ( key1 = 12 ) .`},
{name: "test 13", nquad: `_:alice <knows> "stuff" ( key1 = 12 ) .`, noError: true},
{name: "test 14", nquad: `_:alice <knows@some> "stuff" .`, noError: true},
{name: "test 15", nquad: `_:alice <knows@some@en> "stuff" .`, noError: false},
{name: "test 15", nquad: `_:alice <knows@some@en> "stuff" .`},
}

for _, tc := range tests {
Expand Down
32 changes: 22 additions & 10 deletions ee/acl/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ var (
userpassword = "simplepassword"
)

func makeRequestAndRefreshTokenIfNecessary(t *testing.T, token *testutil.HttpToken, params testutil.GraphQLParams) *testutil.GraphQLResponse {
func makeRequestAndRefreshTokenIfNecessary(t *testing.T, token *testutil.HttpToken,
params testutil.GraphQLParams) *testutil.GraphQLResponse {

resp := testutil.MakeGQLRequestWithAccessJwt(t, &params, token.AccessJwt)
if len(resp.Errors) == 0 || !strings.Contains(resp.Errors.Error(), "Token is expired") {
return resp
Expand All @@ -55,6 +57,7 @@ func makeRequestAndRefreshTokenIfNecessary(t *testing.T, token *testutil.HttpTok
token.RefreshToken = newtoken.RefreshToken
return testutil.MakeGQLRequestWithAccessJwt(t, &params, token.AccessJwt)
}

func createUser(t *testing.T, token *testutil.HttpToken, username, password string) *testutil.GraphQLResponse {
addUser := `
mutation addUser($name: String!, $pass: String!) {
Expand Down Expand Up @@ -103,7 +106,9 @@ func checkUserCount(t *testing.T, resp []byte, expected int) {
require.Equal(t, expected, len(r.AddUser.User))
}

func deleteUser(t *testing.T, token *testutil.HttpToken, username string, confirmDeletion bool) *testutil.GraphQLResponse {
func deleteUser(t *testing.T, token *testutil.HttpToken, username string,
confirmDeletion bool) *testutil.GraphQLResponse {

delUser := `
mutation deleteUser($name: String!) {
deleteUser(filter: {name: {eq: $name}}) {
Expand Down Expand Up @@ -1279,7 +1284,8 @@ func TestExpandQueryWithACLPermissions(t *testing.T) {
// Test that groot has access to all the predicates
resp, err := dg.NewReadOnlyTxn().Query(ctx, query)
require.NoError(t, err, "Error while querying data")
testutil.CompareJSON(t, `{"me":[{"name":"RandomGuy","age":23, "nickname":"RG"},{"name":"RandomGuy2","age":25, "nickname":"RG2"}]}`,
testutil.CompareJSON(t,
`{"me":[{"name":"RandomGuy","age":23, "nickname":"RG"},{"name":"RandomGuy2","age":25, "nickname":"RG2"}]}`,
string(resp.GetJson()))

userClient, err := testutil.DgraphClient(testutil.SockAddr)
Expand Down Expand Up @@ -1334,7 +1340,8 @@ func TestExpandQueryWithACLPermissions(t *testing.T) {
addRulesToGroup(t, token, devGroup, []rule{{"age", Write.Code}, {"name", Read.Code}, {"nickname", Read.Code}})

testutil.PollTillPassOrTimeout(t, userClient, query,
`{"me":[{"name":"RandomGuy","age":23, "nickname":"RG"},{"name":"RandomGuy2","age":25, "nickname":"RG2"}]}`, timeout)
`{"me":[{"name":"RandomGuy","age":23, "nickname":"RG"},{"name":"RandomGuy2","age":25, "nickname":"RG2"}]}`,
timeout)

}
func TestDeleteQueryWithACLPermissions(t *testing.T) {
Expand Down Expand Up @@ -1396,8 +1403,11 @@ func TestDeleteQueryWithACLPermissions(t *testing.T) {
// Test that groot has access to all the predicates
resp, err = dg.NewReadOnlyTxn().Query(ctx, query)
require.NoError(t, err, "Error while querying data")
testutil.CompareJSON(t, `{"q1":[{"name":"RandomGuy","age":23, "nickname": "RG"},{"name":"RandomGuy2","age":25, "nickname": "RG2"}]}`,
string(resp.GetJson()))
testutil.CompareJSON(
t,
`{"q1":[{"name":"RandomGuy","age":23, "nickname": "RG"},{"name":"RandomGuy2","age":25, "nickname": "RG2"}]}`,
string(resp.GetJson()),
)

// Give Write Access to alice for name and age predicate
addRulesToGroup(t, token, devGroup, []rule{{"name", Write.Code}, {"age", Write.Code}})
Expand Down Expand Up @@ -1508,8 +1518,9 @@ func TestValQueryWithACLPermissions(t *testing.T) {
// Test that groot has access to all the predicates
resp, err := dg.NewReadOnlyTxn().Query(ctx, query)
require.NoError(t, err, "Error while querying data")
testutil.CompareJSON(t, `{"q1":[{"name":"RandomGuy","age":23},{"name":"RandomGuy2","age":25}],"q2":[{"val(v)":"RandomGuy","val(a)":23}]}`,
string(resp.GetJson()))
testutil.CompareJSON(t,
`{"q1":[{"name":"RandomGuy","age":23},{"name":"RandomGuy2","age":25}],`+
`"q2":[{"val(v)":"RandomGuy","val(a)":23}]}`, string(resp.GetJson()))

// All test cases
tests := []struct {
Expand Down Expand Up @@ -1733,8 +1744,9 @@ func TestAllPredsPermission(t *testing.T) {
// Test that groot has access to all the predicates
resp, err := dg.NewReadOnlyTxn().Query(ctx, query)
require.NoError(t, err, "Error while querying data")
testutil.CompareJSON(t, `{"q1":[{"name":"RandomGuy","age":23},{"name":"RandomGuy2","age":25}],"q2":[{"val(v)":"RandomGuy","val(a)":23}]}`,
string(resp.GetJson()))
testutil.CompareJSON(t,
`{"q1":[{"name":"RandomGuy","age":23},{"name":"RandomGuy2","age":25}],`+
`"q2":[{"val(v)":"RandomGuy","val(a)":23}]}`, string(resp.GetJson()))

// All test cases
tests := []struct {
Expand Down
16 changes: 12 additions & 4 deletions graphql/e2e/auth/delete_mutation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ func (f *FbPost) add(t *testing.T, user, role string) {
}
}
`,
Variables: map[string]interface{}{"text": f.Text, "id1": f.Author.Id, "id2": f.Sender.Id, "id3": f.Receiver.Id, "postCount": f.PostCount, "pwd": "password"},
Variables: map[string]interface{}{"text": f.Text, "id1": f.Author.Id, "id2": f.Sender.Id,
"id3": f.Receiver.Id, "postCount": f.PostCount, "pwd": "password"},
}
gqlResponse := getParams.ExecuteAsPost(t, common.GraphqlURL)
common.RequireNoGQLErrors(t, gqlResponse)
Expand Down Expand Up @@ -205,13 +206,19 @@ func TestAuth_DeleteOnInterfaceWithAuthRules(t *testing.T) {

for _, tcase := range testCases {
// Fetch all the types implementing `Post` interface.
allQuestions, allAnswers, allFbPosts, allPostsIds := getAllPosts(t, []string{"[email protected]", "[email protected]"}, []string{"ADMIN"}, []bool{true, false})
allQuestions, allAnswers, allFbPosts, allPostsIds := getAllPosts(t,
[]string{"[email protected]", "[email protected]"}, []string{"ADMIN"}, []bool{true, false})
require.True(t, len(allQuestions) == 3)
require.True(t, len(allAnswers) == 2)
require.True(t, len(allFbPosts) == 2)
require.True(t, len(allPostsIds) == 7)

deleteQuestions, deleteAnswers, deleteFbPosts, _ := getAllPosts(t, []string{tcase.user}, []string{tcase.role}, []bool{tcase.ans})
deleteQuestions, deleteAnswers, deleteFbPosts, _ := getAllPosts(
t,
[]string{tcase.user},
[]string{tcase.role},
[]bool{tcase.ans},
)

params := &common.GraphQLParams{
Headers: common.GetJWTForInterfaceAuth(t, tcase.user, tcase.role, tcase.ans, metaInfo),
Expand Down Expand Up @@ -321,7 +328,8 @@ func TestAuth_DeleteOnTypeWithGraphTraversalAuthRuleOnInterface(t *testing.T) {
for _, tcase := range testCases {
t.Run(tcase.user+strconv.FormatBool(tcase.ans), func(t *testing.T) {
// Get all Question ids.
_, allQuestionsIds := getAllQuestions(t, []string{"[email protected]", "[email protected]"}, []bool{true, false})
_, allQuestionsIds := getAllQuestions(t,
[]string{"[email protected]", "[email protected]"}, []bool{true, false})
require.True(t, len(allQuestionsIds) == 3)
deleteQuestions, _ := getAllQuestions(t, []string{tcase.user}, []bool{tcase.ans})

Expand Down
7 changes: 5 additions & 2 deletions graphql/e2e/auth/update_mutation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ func getAllQuestions(t *testing.T, users []string, answers []bool) ([]*Question,
return questions, keys
}

func getAllPosts(t *testing.T, users []string, roles []string, answers []bool) ([]*Question, []*Answer, []*FbPost, []string) {
func getAllPosts(t *testing.T, users []string, roles []string, answers []bool) (
[]*Question, []*Answer, []*FbPost, []string) {

Questions, getAllQuestionIds := getAllQuestions(t, users, answers)
Answers, getAllAnswerIds := getAllAnswers(t, users)
FbPosts, getAllFbPostIds := getAllFbPosts(t, users, roles)
Expand Down Expand Up @@ -428,7 +430,8 @@ func getAllLogs(t *testing.T, users, roles []string) ([]*Log, []string) {
}

func TestAuth_UpdateOnInterfaceWithAuthRules(t *testing.T) {
_, _, _, ids := getAllPosts(t, []string{"[email protected]", "[email protected]"}, []string{"ADMIN"}, []bool{true, false})
_, _, _, ids := getAllPosts(t, []string{"[email protected]", "[email protected]"},
[]string{"ADMIN"}, []bool{true, false})
testCases := []TestCase{{
name: "Only 2 nodes satisfy auth rules with the given values and hence should be updated",
user: "[email protected]",
Expand Down
20 changes: 16 additions & 4 deletions graphql/e2e/common/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4117,7 +4117,15 @@ func intWithList(t *testing.T) {
}
}
}`,
variables: map[string]interface{}{"post1": []interface{}{map[string]interface{}{"title": "Dgraph", "commentsByMonth": []int{2, 33, 11, 6}, "likesByMonth": []int64{4, 33, 1, 66}}}},
variables: map[string]interface{}{
"post1": []interface{}{
map[string]interface{}{
"title": "Dgraph",
"commentsByMonth": []int{2, 33, 11, 6},
"likesByMonth": []int64{4, 33, 1, 66},
},
},
},

expected: `{
"addpost1": {
Expand Down Expand Up @@ -5513,7 +5521,9 @@ func inputCoerciontoList(t *testing.T) {

author1DeleteFilter := map[string]interface{}{"name": map[string]interface{}{"in": []string{"Jack", "Jackob"}}}
DeleteGqlType(t, "author1", author1DeleteFilter, 2, nil)
posts1DeleteFilter := map[string]interface{}{"title": map[string]interface{}{"in": []string{"Dgraph", "GraphQL", "RDBMS", "DB"}}}
posts1DeleteFilter := map[string]interface{}{
"title": map[string]interface{}{"in": []string{"Dgraph", "GraphQL", "RDBMS", "DB"}},
}
DeleteGqlType(t, "post1", posts1DeleteFilter, 4, nil)

}
Expand Down Expand Up @@ -5984,8 +5994,10 @@ func upsertMutationTests(t *testing.T) {
}
gqlResponse = addStateParams.ExecuteAsPost(t, GraphqlURL)
require.NotNil(t, gqlResponse.Errors)
require.Equal(t, "couldn't rewrite mutation addState because failed to rewrite mutation payload because id S1 already exists for field xcode inside type State",
gqlResponse.Errors[0].Error())
require.Equal(t,
"couldn't rewrite mutation addState because failed to rewrite mutation payload because id S1 already exists for field xcode inside type State",
gqlResponse.Errors[0].Error(),
)

// Add Mutation with upsert true should succeed. It should link the state to
// existing country
Expand Down
27 changes: 21 additions & 6 deletions graphql/e2e/common/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,14 @@ func entitiesQueryWithKeyFieldOfTypeString(t *testing.T) {

JSONEqGraphQL(t, expectedJSON, string(entitiesResp.Data))

spaceShipDeleteFilter := map[string]interface{}{"id": map[string]interface{}{"in": []string{"SpaceShip1", "SpaceShip2", "SpaceShip3", "SpaceShip4"}}}
spaceShipDeleteFilter := map[string]interface{}{
"id": map[string]interface{}{"in": []string{"SpaceShip1", "SpaceShip2", "SpaceShip3", "SpaceShip4"}},
}
DeleteGqlType(t, "SpaceShip", spaceShipDeleteFilter, 4, nil)

missionDeleteFilter := map[string]interface{}{"id": map[string]interface{}{"in": []string{"Mission1", "Mission2", "Mission3", "Mission4"}}}
missionDeleteFilter := map[string]interface{}{
"id": map[string]interface{}{"in": []string{"Mission1", "Mission2", "Mission3", "Mission4"}},
}
DeleteGqlType(t, "Mission", missionDeleteFilter, 4, nil)

}
Expand Down Expand Up @@ -486,7 +490,9 @@ func entitiesQueryWithKeyFieldOfTypeInt(t *testing.T) {
planetDeleteFilter := map[string]interface{}{"id": map[string]interface{}{"in": []int{1, 2, 3, 4}}}
DeleteGqlType(t, "Planet", planetDeleteFilter, 4, nil)

missionDeleteFilter := map[string]interface{}{"id": map[string]interface{}{"in": []string{"Mission1", "Mission2", "Mission3", "Mission4"}}}
missionDeleteFilter := map[string]interface{}{
"id": map[string]interface{}{"in": []string{"Mission1", "Mission2", "Mission3", "Mission4"}},
}
DeleteGqlType(t, "Mission", missionDeleteFilter, 4, nil)

}
Expand Down Expand Up @@ -2518,7 +2524,11 @@ func queryWithCascade(t *testing.T) {
}
}
}`,
variables: map[string]interface{}{"ids": authorIds, "fieldsRoot": []string{"reputation", "name"}, "fieldsDeep": []string{"text"}},
variables: map[string]interface{}{
"ids": authorIds,
"fieldsRoot": []string{"reputation", "name"},
"fieldsDeep": []string{"text"},
},
respData: `{
"queryAuthor": [
{
Expand Down Expand Up @@ -3118,7 +3128,10 @@ func persistedQuery(t *testing.T) {

// test get method as well
queryCountryParams.Extensions = nil
gqlResponse = queryCountryParams.ExecuteAsGet(t, GraphqlURL+`?extensions={"persistedQuery":{"sha256Hash":"bbc0af44f82ce5c38e775f7f14c71e5eba1936b12b3e66c452ee262ef147f1ed"}}`)
gqlResponse = queryCountryParams.ExecuteAsGet(
t,
GraphqlURL+`?extensions={"persistedQuery":{"sha256Hash":"bbc0af44f82ce5c38e775f7f14c71e5eba1936b12b3e66c452ee262ef147f1ed"}}`,
)
RequireNoGQLErrors(t, gqlResponse)
}

Expand Down Expand Up @@ -3763,7 +3776,9 @@ func queryFilterWithIDInputCoercion(t *testing.T) {
}
}
}`,
variables: map[string]interface{}{"filter": map[string]interface{}{"id": []int{cast.ToInt(authors[0].ID), cast.ToInt(authors[1].ID)}}},
variables: map[string]interface{}{
"filter": map[string]interface{}{"id": []int{cast.ToInt(authors[0].ID), cast.ToInt(authors[1].ID)}},
},
respData: `{
"queryAuthor": [
{
Expand Down
Loading

0 comments on commit d7484b1

Please sign in to comment.