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

GraphQL interface for products pt. 3 #1325

Merged
merged 22 commits into from
May 27, 2024

Conversation

pylipp
Copy link
Collaborator

@pylipp pylipp commented Apr 22, 2024

Review guide

What's new?

  1. the StandardProduct data model and the corresponding GraphQL type
  2. GraphQL queries to retrieve standard products (either by ID, or a list of them)
  3. GraphQL mutations to enable/edit/disable standard product instantiations for a base
  4. a new resource-based permission standard_product:read (for the view_inventory action-based permission)

Functional review

Only the dev_coordinator@boxaid.org user has the new RBP granted in Auth0.

query { standardProduct(id: 1) { ...on StandardProduct { name version } } }
query { standardProducts { ...on StandardProductPage { elements { name version } } } }

mutation { enableStandardProduct(enableInput: { standardProductId: 1, baseId: 1 }) { ...on Product { id name type price base { id } createdOn } } }
mutation { editStandardProductInstantiation(editInput: { id: X, price: 1 }) { ...on Product { price } } }
mutation { disableStandardProduct(id: X) { ...on Product { deletedOn } } }

Notes/questions

  • the standardProduct* queries return a union type wrapping the actual resource and errors
  • what filters could be useful for standardProducts query? E.g. only the newest version, or filtering for certain versions?
  • should we return an error when editing/deleting deleted products?

Refernces

@pylipp pylipp force-pushed the updated-graphql-interface-for-products-part-III branch 2 times, most recently from ba4b6af to 959b719 Compare April 23, 2024 15:30
@pylipp pylipp force-pushed the updated-graphql-interface-for-products-part-III branch 2 times, most recently from 4afca60 to ee2a006 Compare April 23, 2024 16:06
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.24%. Comparing base (f50e965) to head (614afbf).

Current head 614afbf differs from pull request most recent head 0380ba9

Please upload reports for the commit 0380ba9 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1325      +/-   ##
==========================================
+ Coverage   85.15%   85.24%   +0.09%     
==========================================
  Files         226      225       -1     
  Lines       20940    21015      +75     
  Branches     1588     1570      -18     
==========================================
+ Hits        17832    17915      +83     
- Misses       3091     3094       +3     
+ Partials       17        6      -11     
Flag Coverage Δ
backend 99.44% <100.00%> (+0.22%) ⬆️
frontend 82.49% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pylipp pylipp force-pushed the updated-graphql-interface-for-products-part-III branch 2 times, most recently from 82a1f8c to c72c0e7 Compare April 25, 2024 09:33
@pylipp pylipp force-pushed the updated-graphql-interface-for-products-part-III branch from c72c0e7 to 614afbf Compare April 25, 2024 10:01
@pylipp
Copy link
Collaborator Author

pylipp commented Apr 25, 2024

@pylipp pylipp marked this pull request as ready for review April 25, 2024 11:04
@pylipp pylipp requested a review from HaGuesto April 25, 2024 14:56
Copy link
Member

@HaGuesto HaGuesto left a comment

Choose a reason for hiding this comment

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

code review passed

Copy link
Member

@HaGuesto HaGuesto left a comment

Choose a reason for hiding this comment

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

functional review passed

@pylipp pylipp force-pushed the updated-graphql-interface-for-products-part-III branch from b61bbc7 to 87a8a6b Compare May 27, 2024 14:38
@pylipp pylipp merged commit f99df6c into master May 27, 2024
9 checks passed
@pylipp pylipp deleted the updated-graphql-interface-for-products-part-III branch May 27, 2024 15:10
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.

None yet

2 participants