Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Add Change getter graphQL api #905

Merged
merged 7 commits into from
Jun 29, 2020
Merged

Add Change getter graphQL api #905

merged 7 commits into from
Jun 29, 2020

Conversation

rohithbalaji123
Copy link
Member

Part of #612

New Behavior

Description

Add changes graphQL API to fetch all the changes available to be displayed in admin panel. This is different from changeLog in the sense that, changeLog also fetches lastViewedAt timestamp which is not related to admin panel functionalities. The newly added API internally reuses the same repository methods used for changeLog. This also adds the permission check whether the user can view the changes.

@rohithbalaji123 rohithbalaji123 added the enhancement New feature or request label Jun 28, 2020
@rohithbalaji123 rohithbalaji123 self-assigned this Jun 28, 2020
@codecov
Copy link

codecov bot commented Jun 28, 2020

Codecov Report

Merging #905 into master will decrease coverage by 0.13%.
The diff coverage is 31.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #905      +/-   ##
==========================================
- Coverage   52.40%   52.26%   -0.14%     
==========================================
  Files         133      133              
  Lines        3227     3249      +22     
  Branches      157      157              
==========================================
+ Hits         1691     1698       +7     
- Misses       1468     1482      +14     
- Partials       68       69       +1     
Flag Coverage Δ
#golang 70.47% <31.81%> (-0.44%) ⬇️
#typescript 23.65% <ø> (ø)
Impacted Files Coverage Δ
backend/app/adapter/gqlapi/resolver/authquery.go 31.11% <0.00%> (-10.07%) ⬇️
backend/app/usecase/authorizer/authorizer.go 33.33% <0.00%> (-6.67%) ⬇️
backend/app/usecase/changelog/changelog.go 82.50% <77.77%> (-0.60%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c05f3c7...83c39f8. Read the comment docs.

@rohithbalaji123 rohithbalaji123 changed the title Change getter api Add Change getter graphQL api Jun 28, 2020
Copy link
Member

@arberiii arberiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rohithbalaji123! Thank you for working on this! Left a few small comments.

backend/app/usecase/changelog/changelog_test.go Outdated Show resolved Hide resolved
backend/app/adapter/gqlapi/resolver/authquery.go Outdated Show resolved Hide resolved
@magicoder10
Copy link
Member

@rohithbalaji123 GraphQL client side query can decide which fields to fetch and ignore those that are not needed.

backend/app/adapter/gqlapi/schema.go Outdated Show resolved Hide resolved
backend/app/usecase/changelog/changelog.go Outdated Show resolved Hide resolved
@rohithbalaji123
Copy link
Member Author

The reason why I went for a new API is that they are being used for completely different purposes and their fetching mechanism might change in future.
For instance, when we start implementing #595 , that will be specific to user side changelogs, while admin will still need to get all the changes.

@rohithbalaji123 rohithbalaji123 merged commit bcb30df into master Jun 29, 2020
@rohithbalaji123 rohithbalaji123 deleted the change-getter-api branch June 29, 2020 05:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants