Skip to content

variable limit not work? #445

@gaolegaole

Description

@gaolegaole

go version go1.20 windows/amd64
graphjin version: v3
my code is follow:

func TestGraphjinQuery(t *testing.T) {
	db, _ := store.DB() //mysql db
	gql := `query {
		cloud_storage(limit: $limit) {
			id
			name
		}
	}`

	vars := json.RawMessage(`{
		"limit": 3
	}`)

	conf, err := config.NewConfig("../config", "dev.yml")
	require.NoError(t, err)
	gj, err := core.NewGraphJin(conf, db)
	if err != nil {
		panic(err)
	}

	res, err := gj.GraphQL(context.Background(), gql, vars, nil)
	require.NoError(t, err)
	t.Log(res.Data)

}

output:

Error Trace:	D:/code/model/base_crud_test.go:700
Error:      	Received unexpected error:
        	limit: mysql: value for argument 'limit' must be a number
Test:       	TestGraphjinQuery

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions