Open david-w-shopify opened 3 months ago
I have found the same behaviour with Orders
.
Using this snippet:
const { admin, session } = await authenticate.admin(request);
const orderData = {
email: "foo@example.com",
fulfillment_status: "fulfilled",
fulfillments: [
{
location_id: 24826418,
},
],
line_items: [
{
variant_id: 447654529,
quantity: 1,
},
],
};
const order = new admin.rest.resources.Order({
session,
fromData: orderData,
});
await order.save({ update: true });
A new order will be created without error.
A 400 error is thrown:
errors: { order: 'Required parameter missing or invalid' }
Thank you for reporting this @david-w-shopify, we'll take a look.
We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.
You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.
I got the same thing with Webhook. Logging in the constructor of Base showed me a correctly updated 'this' from 'fromData' right before exiting. Commenting the field block at the end of webhook.mjs made it work properly. And that is the length of my analysis on this. Note fromData was working for me a few months ago.
Issue summary
Before opening this issue, I have:
@shopify/shopify-api
package and version: 11.0.1@shopify/shopify-app-remix
package and version: 3.0.1Theme
rest resource no longer hasfromData
applied to it. I suspect this is happening with other rest resources too, but it's only impacted me with themes.Using this snippet
Expected behavior
Using the above snippet I'd expect this to be logged:
Actual behavior
I get this
Steps to reproduce the problem
I've created this repo to reproduce the issue: https://github.com/david-w-shopify/shopify-rest-resource-issue.
app/routes/app.tsx
the reproduction repopnpm dev
and install the app on a test storetheme
variable being logged