Open theobat opened 7 years ago
Ok so the problem was I only had one entry in my variables object when requesting cashay.query(...) And this variable was "undefined" at the time I was doing my query. What happens in that case is that when a variable is missing to query the server cashay removes this variable to find out which endpoint to take. Seemingly, the problem is that when you remove the only existing (not quite, let's say expected) variable cashay fails silently and never calls the server.
It's not a bug of cashay (the variable should not have been null on my end, that was the bug) but I would definitely add a test case and a proper error message in that case (when I'm done figuring everything out !)
ah, sorry for not responding to this...
so cashay allows for multi-part queries. for example, part 1 is getting a list of posts, part 2 is getting the comments for each post. How it does that is by seeing if the variable is undefined. so on first pass, the variable is undefined, so it ignores that part. when the variable is something useful (provided by the response of the first query) then it knows it can proceed to request the second part.
hope that makes sense!
@mattkrick thanks for your answer ! It does make sense but I'm not sure how we actually do the multi part query (and where it makes clear sense). There should be a mean to detect the number of part in the query and raise an error if minimizedQueryString is null and partNumber === 1 no ?
hey @mattkrick, two things:
Are you interested in a PR that actually raises an error here (or is there any particular reason not to raise an error ?): (been strugguling with this silently failing)
Do you have any hint/help to understand why minimizedQueryString is undefined ? I believe it is related to my graphqlSchema but I'm still searching what's happening under the hood