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

Error if get-query in :query outside of a join #383

Merged

Conversation

holyjak
Copy link
Collaborator

@holyjak holyjak commented Mar 8, 2020

E.g. :query [:my/key (comp/get-query MyChild)] will fail with

defsc MyComponent: get-query calls in :query can only be inside a join value,
i.e. {:some/key (comp/get-query Header)} at ...

Note: I do not include the preceeding key so that I also catch
:query [(get-query AnotherChild)] and b/c I cannot know whether
it is intended as a key for the join or an unrelated property.

@holyjak
Copy link
Collaborator Author

holyjak commented Mar 8, 2020

Should I perhaps add a test for this case to test/com/fulcrologic/fulcro/macros/defsc_spec.clj / somewhere?

@holyjak holyjak force-pushed the feature/warn-get-query-missing-join branch from 17eab54 to 6497085 Compare March 8, 2020 19:23
E.g. `:query [:my/key (comp/get-query MyChild)]` will fail with

> defsc MyComponent: `get-query` calls in :query can only be inside a join value,
> i.e. `{:some/key (comp/get-query Header)}` at ...

Note: I do not include the preceeding key so that I also catch
`:query [(get-query AnotherChild)]` and b/c I cannot know whether
it is intended as a key for the join or an unrelated property.
@holyjak holyjak force-pushed the feature/warn-get-query-missing-join branch from 6497085 to 4037185 Compare March 8, 2020 19:35
@awkay awkay merged commit 07af7c4 into fulcrologic:develop Mar 9, 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

2 participants