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

Update parameters.cljs example to quote query before being passed to parser #169

Merged
merged 3 commits into from
Aug 19, 2020

Conversation

tylernisonoff
Copy link
Contributor

(clojure.core.async/<!! (parser {} [(::instruments {:sort :instrument/brand})])))

will evaluate the sub-expression [(::instruments {:sort :instrument/brand})] before it reaches the parser function. Thus, if we want to specify a parameter, we have to make sure it's quoted.

I also added a Note about this in the docs, but I wasn't sure if this was wanted. Happy to remove if it's not warranted.


*Note:* If you are calling the parser directly, be sure to quote your query when using parameters like so:
```clojure
(parser {} (parser {} '[(::instruments {:sort :instrument/brand})])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you repeated the parser

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh sorry about that! not sure what happened there..

docs/index.adoc Outdated
@@ -673,6 +673,21 @@ Try it out:
<div class="space"></div>
++++

*Note:* If you are calling the parser directly, be sure to quote your query when using parameters like so:
```clojure
(parser {} (parser {} '[(::instruments {:sort :instrument/brand})])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

@tylernisonoff
Copy link
Contributor Author

Thanks for the comments, updated

@wilkerlucio
Copy link
Owner

Thanks!

@wilkerlucio wilkerlucio merged commit 997452b into wilkerlucio:master Aug 19, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants