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

feat(graphql): support filtering based on greater than/less than criteria #9001

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

iprentic
Copy link
Contributor

Example usage:

{
  searchAcrossEntities
(
    input: {types: [], query: "*", orFilters: 
[{and: [{field: "<numeric property>", condition: GREATER_THAN, values:["400"], negated: false}]}]}
) {
  searchResults {
    entity {
      urn,
      type
    }
  } 
  }
}

This PR is so short because the condition is parsed from GraphQL using Condition.valueOf:

result.setCondition(Condition.valueOf(filter.getCondition().toString()));

And these already exist as conditions:

So, simply add them as options in the GraphQL API to support filtering by them

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Oct 12, 2023
@iprentic iprentic merged commit 78b342f into master Oct 13, 2023
37 checks passed
@iprentic iprentic deleted the nd--search-operators branch October 13, 2023 22:04
@maggiehays maggiehays added the hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants