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

Variables field sent as [object Object] in GET requests #416

Closed
macalinao opened this issue Apr 8, 2017 · 8 comments
Closed

Variables field sent as [object Object] in GET requests #416

macalinao opened this issue Apr 8, 2017 · 8 comments

Comments

@macalinao
Copy link

My "Query Variables" is being sent as an [object Object]. There is probably a .toString call where there should really be a JSON.stringify.

screen shot 2017-04-07 at 19 29 37
screen shot 2017-04-07 at 19 29 57

@asiandrummer
Copy link
Contributor

@macalinao Are you unable to execute a query? I think we've decided to send a JSON object instead of JSON string a while ago.

@macalinao
Copy link
Author

Yes. What do you mean by sending a JSON object instead of JSON string?

@asiandrummer
Copy link
Contributor

@macalinao oh sorry - I meant we had a discussion in #168 to change passing in variables in JSON object instead of string.

@macalinao
Copy link
Author

ah, well it shouldn't be sending [object Object] should it? Or is it actually sending a JSON string and Chrome dev tools is showing some other representation?

@jborden
Copy link

jborden commented May 5, 2017

I can confirm I am having this same problem with Query Variables. It seems to be isolated to the HTTP GET method calls. HTTP POST calls will gladly pass on the proper Query Variables in the request body, but for HTTP GET method calls the query is passed on with the parameters while the variables are just a string "[object Object]".

@wincent
Copy link
Contributor

wincent commented May 5, 2017

Can I get some clarification here on how to repro this exactly?

@jeroenbe
Copy link

I'm having the same issue:
I'm using the electron app to query a neo4j db with graphql (if you want to go through the hassle: neo4j-graphql).

When inspecting the requests with charles and copying them as a cURL request I noticed &variables\=%5Bobject%20Object%5D (-> [object Object]) at the end of my request. When no variables are given the ending looks like: &variables=null. When replacing the values with an encoded object, everything goes fine. Effectively ruling out the server as the culprit.

I understand there's a lot of indirect stuff going on in tracing my issue, but I'm fairly confident it's the same one as described above.

@macalinao
Copy link
Author

macalinao commented Jun 1, 2017

@wincent to reproduce, send a GraphQL request via GET with some variables.

The above comment by @jeroenbe describes the issue pretty well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants