-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactor of roles service to allow separately querying journey roles from org roles #3177
Conversation
…from organization roles
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.
I see a lot of async/await in your code that are not required.
You can think of the await
basically as execution. It should only be used if you need the value right now, in your next line, otherwise, you just pass around the promise.
Overall the implementations look good. An additional optimization leveraged by resolvers.
Rational for this PR is that the userRoles query always was getting both all journey roles and all organization roles - regardless of what fields were being requested. And in the latest update from Andrew the code does request the different roles separately - which leads to an inefficient api.
The graphql api has not changed, this is a pure internal optimization that is important to allow client querying of organizational roles to be fast - currently it is still getting all the journey roles in the business logic.
Design:
Important is that the logic path for organization roles is now fully independent of that of journey roles, as they are different (space visibilities etc makes no sense on organization roles).