orbitjs / orbit

Composable data framework for ambitious web applications.
https://orbitjs.com
MIT License
2.33k stars 134 forks source link

[Docs] Update "Relationship filtering" section in querying docs #895

Closed bradjones1 closed 2 years ago

bradjones1 commented 2 years ago
dgeb commented 2 years ago

Thanks for the PR @bradjones1 :)

In my testing, it looks like the correct key is records in the relationship filter object... it's inconsistent between the two examples.

For hasOne relationships the filter checks record not records. For hasMany relationships, records is checked.

If you're seeing different behavior, can you specify which version of orbit and which orbit source (memory / jsonapi / etc) you're using?

bradjones1 commented 2 years ago

Thanks for the gut-check on that. I actually moved to getting the records in question via an include from a related entity, so I don't have that code anymore. I think I might have just had myself turned in a knot.

I think this still should be under an H3 though ;-)

dgeb commented 2 years ago

Ah thanks for the clarification on the filter.

The header I think should be an H3, otherwise it doesn't show up in the navigation and gets lost.

I can see what you mean that this rather important heading gets lost in the side nav. The issue with just changing this one H4 -> H3 is that there is another section just above, Attribute filtering, that should be at the same level as Relationship filtering. I think we can make this work by doing the following:

Would you mind making these two additions to your PR?

bradjones1 commented 2 years ago

Done, thanks for the review.

dgeb commented 2 years ago

Looks great, thanks @bradjones1!