boxtribute
boxtribute copied to clipboard
GraphQL interface for products pt. 3
Review guide
What's new?
- the
StandardProduct
data model and the corresponding GraphQL type - GraphQL queries to retrieve standard products (either by ID, or a list of them)
- GraphQL mutations to enable/edit/disable standard product instantiations for a base
- a new resource-based permission
standard_product:read
(for theview_inventory
action-based permission)
Functional review
Only the [email protected]
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?