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

Feature Request: Query Predicate Operation: attributeExists #4130

Closed
7 of 14 tasks
MarlonJD opened this issue Nov 15, 2023 · 8 comments
Closed
7 of 14 tasks

Feature Request: Query Predicate Operation: attributeExists #4130

MarlonJD opened this issue Nov 15, 2023 · 8 comments
Assignees
Labels
feature-parity A request for a feature that is fully or partially available on another platform (JS, iOS, Android) feature-request A request for a new feature or an enhancement to an existing API or category. GraphQL API Issues related to the API (GraphQL) Category pending-release Issues that have been addressed in main but have not been released

Comments

@MarlonJD
Copy link
Contributor

MarlonJD commented Nov 15, 2023

Description

Hello, on amplify-flutter there is no attributeExists on where parameters while ModelQueries.list.

I needed this when eq(null) was not enough, If there is no key in dynamodb it gives false result, so we need this attributeExists in these cases.

ModelQueries.list(Employee.classType,
            where: Employee.COGNITOID.attributeExists(false));

I'm planning to add this, what do you about it?

Detailed Example Use Case, why we need this?

Post(title: "Lorem ipsum", blog: null, ...)

we want to list posts with no blogs assigned, if belongsTo model was null, in dynamoDB there wouldn't be any attribute. So if we try to list this:

final req = ModelQueries.list(
  Post.classType,
  where: Post.BLOG.eq(null),
  limit: _limit,
);

it won't give us right results. it should've customized document and variables for this.

This feature allow us to do this.

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

No response

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.3.10

Amplify Flutter Version

0.6.10

Deployment Method

Amplify CLI

Schema

No response

@Equartey Equartey added feature-request A request for a new feature or an enhancement to an existing API or category. GraphQL API Issues related to the API (GraphQL) Category pending-triage This issue is in the backlog of issues to triage labels Nov 15, 2023
@MarlonJD
Copy link
Contributor Author

I just add #4134 for this issue

@Equartey
Copy link
Contributor

@MarlonJD Awesome, thanks for opening a pull request!

We need to review this internally before we can take your changes. Will provide updates as I have them.

@Equartey Equartey removed the pending-triage This issue is in the backlog of issues to triage label Nov 16, 2023
@Equartey Equartey self-assigned this Nov 16, 2023
@MarlonJD
Copy link
Contributor Author

MarlonJD commented Nov 16, 2023

@Equartey I can clone and try to pass tests, I was did some online GitHub edit quickly then tests not working for now

@Equartey
Copy link
Contributor

@MarlonJD No need, tests are not the issue. We need to review the implementation to ensure it doesn't collide with DataStore category.

@MarlonJD
Copy link
Contributor Author

@Equartey yes, that's true, I didn't test datastore side, okay than I'll wait your response about it, thanks.

@MarlonJD MarlonJD changed the title Future Request: Query Predicate Operation: attributeExists Feature Request: Query Predicate Operation: attributeExists Dec 4, 2023
@Equartey Equartey added the feature-parity A request for a feature that is fully or partially available on another platform (JS, iOS, Android) label Dec 7, 2023
@Equartey
Copy link
Contributor

@MarlonJD apologies for the delay. Your feature work has been merged 🎉

We will let you know when its released and available. Thanks again for your contribution, it's highly appreciated!

@Equartey Equartey added the pending-release Issues that have been addressed in main but have not been released label Apr 30, 2024
@MarlonJD
Copy link
Contributor Author

@Equartey Thanks for your corrections on the PR, you did great work for datastore and tests, I'm happy that it's merged. 🎉

@Jordan-Nelson
Copy link
Member

This was added in Amplify Flutter v2 which was released a couple weeks ago. There were some breaking changes in this version. Please see the upgrade guide for more info.

@MarlonJD Thanks for opening the issue and your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-parity A request for a feature that is fully or partially available on another platform (JS, iOS, Android) feature-request A request for a new feature or an enhancement to an existing API or category. GraphQL API Issues related to the API (GraphQL) Category pending-release Issues that have been addressed in main but have not been released
Projects
None yet
Development

No branches or pull requests

3 participants