Open MartinSStewart opened 4 years ago
Same problem (and same workaround) here.
Although you can't say that the behaviour of the toQuery
function is wrong, it is a pitfall that the produced output is not a direct acceptable input for the query
field of the Url
record in the same package.
Just mentioning the exact requirements of the query
field of the Url
record and what toQuery
actually produces in the docs would be immensely helpful to avoid this pitfall.
I wanted to take an existing url and modify the query parameters. I noticed
Url
is just a record type so I figured the correct way to do this isbut when I did that the result was
http://localhost:3000/??data=test
instead ofhttp://localhost:3000/?data=test
.This seems to be a bug or at least unintuitive behavior and what I ended up doing to make it work was add
String.dropLeft 1
to thetoQuery
output.