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

Sort between different object types with same path #7

Open
Speedy37 opened this issue Sep 25, 2017 · 0 comments
Open

Sort between different object types with same path #7

Speedy37 opened this issue Sep 25, 2017 · 0 comments

Comments

@Speedy37
Copy link
Contributor

The current implementation of the sort is strict: if a query result in a list of two kind of objects, any sort on that list must be on the exact same attributes and orders.

It's possible to relax this restriction by saying:

A is declared as A { a, b, c }
B is declared as B { a, d, c }

A: { '.': ['+a', '+b'] },
B: { '.': ['+a'] },
is valid, and mean order by "a asc" then by "b asc" if b exists otherwise consider b value as being an empty string or zero depending of the type.

A: { '.': ['+a', '+b', '+c'] },
B: { '.': ['+a', '+c'] },
is valid and mean order by a, then b if any, then c.

The rules for an attribute to differ would be:

  • it can't be the first attribute (to prevent common mistakes)
  • it can't exists on the other type (to prevent common mistakes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant