Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variable limit not work? #445

Open
gaolegaole opened this issue Jun 19, 2023 · 1 comment
Open

variable limit not work? #445

gaolegaole opened this issue Jun 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@gaolegaole
Copy link

gaolegaole commented Jun 19, 2023

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
@gaolegaole gaolegaole added the bug Something isn't working label Jun 19, 2023
@gaolegaole
Copy link
Author

postgres database is ok , but mysql not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant