-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add new query getOrganizationsByEmailPaginated #157
base: master
Are you sure you want to change the base?
Conversation
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes needed
|
const data = await masterdata.searchDocumentsWithPaginationInfo({ | ||
dataEntity: config.name, | ||
fields: ['clId', 'costId', 'id', 'orgId', 'roleId'], | ||
pagination: { page, pageSize }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when querying paginated data from Master Data, we should add sort
(e.g. sort: 'id asc',
otherwise we might get inconsistent data result (e.g. duplicated entries) when querying a lot of data/pages.
@@ -816,6 +816,44 @@ export const getOrganizationsByEmail = async ( | |||
} | |||
} | |||
|
|||
export const getOrganizationsByEmailPaginated = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, it doesn't make sense to implement the query here, it should be implemented on b2b-organization-graphql.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rudge the intention of having the query here is to maintain the consistency with the not paginated query that is implemented in the storefront-permissions app as well.
What problem is this solving?
This new query will allow to retrieve the users' organizations paginated.
Currently when an user is associated to a big number of organizations is generating a timeout.
How should this be manually tested?
Access https://timeoutsfp--jamalstore.myvtex.com/admin/graphql-ide
Run the query below in the storefront-permissions app
Screenshots or example usage:
