# Can I use Url Query Parsers by themselves?

**URL:** <https://discourse.elm-lang.org/t/can-i-use-url-query-parsers-by-themselves/1949>\
**Category:** Learn\
**Created:** [September 12, 2018, 4:17pm UTC](https://discourse.elm-lang.org/t/can-i-use-url-query-parsers-by-themselves/1949 "2018-09-12T16:17:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wondible](https://avatars.discourse-cdn.com/v4/letter/w/e9c0ed/32.png) [@wondible](https://discourse.elm-lang.org/u/wondible)\
**Post date:** [September 12, 2018, 4:17pm UTC](https://discourse.elm-lang.org/t/can-i-use-url-query-parsers-by-themselves/1949/1 "2018-09-12T16:17:04Z")

</div>

Since I’ve got a dependency on elm/url now anyway, I was trying to convert my query parameter parsing over in hopes it might cover more corners cases. However, I’ve found the library extremely awkward to deal with.

It seems there is no way to use the query parser directly. I must turn it into a path parser, and a path parser _must_ match the entire path. Leading to hacking the url object:

> { location | path = “” }

Similarly, the API I am working with can return auth calls with a hash that has query like parameters. Leading to similar hack

> { location | path = “”, query = location.fragment }

Is there a cleaner way to do this?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [September 22, 2018, 4:17pm UTC](https://discourse.elm-lang.org/t/can-i-use-url-query-parsers-by-themselves/1949/2 "2018-09-22T16:17:06Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
