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

Relationship filtering - schema inconsistencies #444

Open
Lezek123 opened this issue Jul 2, 2021 · 2 comments
Open

Relationship filtering - schema inconsistencies #444

Lezek123 opened this issue Jul 2, 2021 · 2 comments

Comments

@Lezek123
Copy link
Contributor

Lezek123 commented Jul 2, 2021

Filtering by related entity id

As pointed out by @jodator, there is an inconsitency between the output schema and what is actually supported when it comes to relationship filtering.

For example, previously queries like:

  workers(where: {group_eq:"contentDirectoryWorkingGroup"}) {
    # ...
  }

Were supported (contentDirectoryWorkingGroup is ID of the related WorkingGroup entity in this case).

Currently they have to be rewritten into:

  workers(where: {group: { id_eq: "contentDirectoryWorkingGroup" } }) {
    # ...
  }

But the output schema still contains group_eq and group_in parameters.
Providing any of those currently causes an error:

"column worker.undefined does not exist",

Filtering depth

Another issue is that the output schema doesn't reflect the relationship filtering depth limit, so queries like:

workers(where: { membership: { metadata: { name_eq: "Alice" } } }) {
  # ...
}

Seem to be fine accoring to the schema, but result in an error when executed:

"message": "column membership.undefined does not exist",
@Lezek123 Lezek123 changed the title Filtering by related entity id - schema incosistencies Filtering by related entity id - schema inconsistencies Jul 2, 2021
@Lezek123 Lezek123 changed the title Filtering by related entity id - schema inconsistencies Relationship filtering - schema inconsistencies Jul 2, 2021
@jodator
Copy link

jodator commented Jul 5, 2021

I've found a similar case on *Connection type queries where both forms fail. When used:

query {
  workersConnection(where: { group: { id_eq: "forumWorkingGroup" } }) {
    totalCount
  }
}

it returns an error:

"message": "column workinggroupopening.undefined does not exist",

@ondratra
Copy link
Contributor

Basic filtering is done. Recursive filtering as illustrated in #453 (comment) is not yet implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants