You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PWA studio should take advantage of new graphql features launched in 2.3.1 and replace existing REST queries in Venia. This discovery should result in a clear definition for LOE and scope of changes necessary to move any applicable queries from REST to GraphQL.
✅ POST /rest/V1/guest-carts (can be replaced by createEmptyCart mutation)
✅ POST /rest/V1/guest-carts/:cartId/items (replaceable by addSimpleProductsToCart/addConfigurableProductsToCart mutations)
❌ PUT /rest/V1/guest-carts/:cartId/items/:itemId (no replacement mutation exists)
❌ DELETE /rest/V1/guest-carts/:cartId/items/:itemId (no replacement mutation exists)
❌ GET /rest/V1/guest-carts/:cartId/payment-methods (no replacement query exists)
❌ GET /rest/V1/guest-carts/:cartId/totals (no replacement query exists. a cart query does exist, but it currently doesn't contain total information.)
src/actions/checkout/asyncActions.js
❌POST /rest/V1/guest-carts/:cartId/estimate-shipping-methods (no replaceable mutation exists)
✅POST /rest/V1/guest-carts/:cartId/shipping-information (can be replaced by two mutations, setShippingAddressesOnCart and setShippingMethodsOnCart. there does appear to be some complexity here, it seems to expect cart items are passed with shipping addresses, I presume to support multi-address shipping)
❌POST /rest/V1/guest-carts/:cartId/payment-information (no replacement mutation exists)
src/actions/directory/asyncActions.js
✅GET /rest/V1/directory/countries (can be replaced by countries query)
src/actions/user/asyncActions.js
✅POST /rest/V1/integration/customer/token (can be replaced by generateCustomerToken mutation)
✅GET /rest/V1/customers/me (can be replaced by customer query)
✅POST /rest/V1/customers (can be replaced by createCustomer)
❌PUT /rest/V1/guest-carts/:cartId (no replacement mutation exists. if we wanted to migrate to GraphQL, I think you'd have to create a new cart and copy everything over from the old cart)
src/components/CreateAccount/validators.js
❌POST /rest/V1/customers/isEmailAvailable (no replacement mutation exists)
src/actions/purchaseDetails/restApi.js
❌ MOCK orderDetailsRequest (customerOrders does exist, but the response structure is very light on detail, only contains total and status; no item detail either)
The text was updated successfully, but these errors were encountered:
It's been a little difficult to assess the possible graphql queries provided in 2.3.1 really because of a lack of docs/notes thus far. I'm currently talking to a few people from the team responsible for that work but in the meantime I was given a draft of the release notes so far. I then tried to extract any relevant tickets from the notes and put them in this issue above.
@sirugh - Reviewed your findings and updated the description after confirming your suspicions about what could be replaced. I'll schedule some time with @awilcoxa to review, and break out into stories if this is deemed a priority.
Some GraphQL features were postponed until 2.3.2, so this full assessment will apply to 2.3.2 instead. Three replacements can still be done against 2.3.1:
PWA studio should take advantage of new graphql features launched in 2.3.1 and replace existing REST queries in Venia. This discovery should result in a clear definition for LOE and scope of changes necessary to move any applicable queries from REST to GraphQL.
Remaining REST API usage in repo as of cf29cd6.
See here for parameter/options.
src/actions/cart/asyncActions.js
createEmptyCart
mutation)addSimpleProductsToCart
/addConfigurableProductsToCart
mutations)cart
query does exist, but it currently doesn't contain total information.)src/actions/checkout/asyncActions.js
setShippingAddressesOnCart
andsetShippingMethodsOnCart
. there does appear to be some complexity here, it seems to expect cart items are passed with shipping addresses, I presume to support multi-address shipping)src/actions/directory/asyncActions.js
countries
query)src/actions/user/asyncActions.js
generateCustomerToken
mutation)customer
query)createCustomer
)src/components/CreateAccount/validators.js
src/actions/purchaseDetails/restApi.js
customerOrders
does exist, but the response structure is very light on detail, only contains total and status; no item detail either)The text was updated successfully, but these errors were encountered: