Unable to add additional Shopify model field to schema
I have added the
destination
and deliveryMethod
fields to the ShopifyFulfillmentOrder
model schema.ts
in the shopify fields array however these fields are not being created or reflected in the Gadget UI
Is there a way I can force Gadget to reevalutate the schema.ts file and rebuild the model?
Additionally if I add a junk field that is not supported I get Invalid Shopify field found in "schema.shopify.fields" Your app will not be operational until all fatal errors are fixed.
which suggests that Gadget is happy with the new fields (destination
and deliveryMethod
) since no error is thrown - but is not adding them
Any help would be much appreciated
5 Replies
Hey Kara, at first look I can see that the
deliveryMethod
field is a hasOne to the ShopifyDeliveryMethod
model. The destination
field is also a hasOne to the ShopifyFulfillmentOrderDestination
model. Do you have these models enabled in your shopify connection (and do you have the schema.ts files for them?)Thank you Jenny! Adding those models in worked. In a previous Shopify version those fields were json type so it didn't occur to me that they might need additional models.
Okay new discovery which I don't think is expected behaviour @muchi 🥹
It seems
ShopifyFulfillmentOrderDestination
records are not being created when the fulfillment_orders/order_routing_complete
webhook is received
I would expect these to be created at the same time as the ShopifyFulfillmentOrder
records
I can confirm that the expected relationships exists
ShopifyFulfillmentOrderDestination.fulfillmentOrder
belongsTo
ShopifyFulfillmentOrder
and
ShopifyFulfillmentOrder.destination
hasOne
ShopifyFulfillmentOrderDestination
Let me know if I should create a new bug ticket for this!Hey Kara, do you have a trace id of an example
fulfillment_orders/order_routing_complete
webhook not creating the related ShopifyFulfillmentOrderDestination
record? We do have some logic to fetch for this related data for this webhook topic so I just want to take a closer look!Here is a trace id example
ec3b422f30899b8062033f7d69110c77
- thanks for taking a look!Sorry for the delayed response! We've found the cause of the issue and are working on a fix. We'll update you once that fix is live!