Skip to content

MAB-737: API throwing error if user calls some specific query without edges#127

Open
Joselgc1 wants to merge 1 commit intounesco-mabfrom
MAB-737
Open

MAB-737: API throwing error if user calls some specific query without edges#127
Joselgc1 wants to merge 1 commit intounesco-mabfrom
MAB-737

Conversation

@Joselgc1
Copy link

Description

The issue was that our Mongo aggregation "$project" was mixing inclusion fields (like "id", "createdAt", etc.) with an exclusion ("data: 0"), which Mongo doesn’t allow, so the "totalCount" query crashed. It is now fixed by removing the default "data: 0" exclusion and only adding "data" to the projection when the query actually asks for node fields (or when calculated/sort fields need it).

Useful links

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

( * == Mandatory )

  • - I have set myself as assignee of the pull request
  • - My code follows the style guidelines of this project
  • - Linting does not generate new warnings
  • - I have performed a self-review of my own code
  • - I have put the ticket for review, adding the oort-backend team to the list of reviewers
  • - I have commented my code, particularly in hard-to-understand areas
  • - I have put JSDoc comment in all required places
  • - My changes generate no new warnings
  • - I have included screenshots describing my changes if relevant
  • - I have selected labels in the Pull Request, according to the changes with code brings
  • I have made corresponding changes to the documentation ( if required )
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant