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

Querying a filtered collection breaks on updated documents #379

Closed
adzialocha opened this issue May 17, 2023 · 5 comments · Fixed by #409
Closed

Querying a filtered collection breaks on updated documents #379

adzialocha opened this issue May 17, 2023 · 5 comments · Fixed by #409
Labels
bug Something isn't working

Comments

@adzialocha
Copy link
Member

adzialocha commented May 17, 2023

The following query breaks aquadoggo after eth_public_key field got updated:

{
  profiles: all_profile_0020b1b79c08e8fc478f03bdb240ca1ae082c511b985e970dec9dffffdf0adf0ea76(
    filter: {
      eth_public_key: { eq: "0x7A4862B32Cfe424dDd30f232587C0cb2B032dc98" }
    }
  ) {
    documents {
      fields {
        eth_public_key
        username
      }
    }
  }
}

.. with the following error:

thread 'tokio-runtime-worker' panicked at 'called `Option::unwrap()` on a `None` value', aquadoggo/src/graphql/resolvers.rs:134:30

The query works when removing either the filter or the eth_public_key field:

  • filter + eth_public_key = 💥
  • eth_public_key only = ✅
  • filter only = ✅

Probably related: #356

@adzialocha adzialocha added the bug Something isn't working label May 17, 2023
@sandreae
Copy link
Member

I added one test which passes: 8cd21bd

Maybe we need to add filtering/ordering or only update one of the documents in the collection.

@adzialocha
Copy link
Member Author

I added one test which passes: 8cd21bd

Maybe we need to add filtering/ordering or only update one of the documents in the collection.

Interesting, I'll share later which query failed. Might also be a nested relation 🤔

@adzialocha
Copy link
Member Author

adzialocha commented May 17, 2023

Just noticed that your test doesn't touch the GraphQL bit, but the case we looked at failed in the resolvers logic, maybe the issue is there?

@sandreae
Copy link
Member

Just noticed that your test doesn't touch the GraphQL bit, but the case we looked at failed in the resolvers logic, maybe the issue is there?

Yeh, should check there as well. There's not a lot (in terms of query logic) going on in the GraphQL though, so my instinct is that we can observe it here. Might be wrong about that of course.

@adzialocha adzialocha changed the title Querying a collection breaks on updated documents Querying a filtered collection breaks on updated documents May 18, 2023
@adzialocha
Copy link
Member Author

I've added more information now, we're getting closer:

Interesting, I'll share later which query failed. Might also be a nested relation thinking

Don't think that's the case, since this query does not contain any nesting (the other one did).

Maybe we need to add filtering/ordering or only update one of the documents in the collection.

Definitely breaking when adding filtering, don't think its about ordering or that it's only one document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants