Shopify / shopify-api-ruby

ShopifyAPI is a lightweight gem for accessing the Shopify admin REST and GraphQL web services.
MIT License
1.06k stars 473 forks source link

Sorbet error on ShopifyAPI::FulfillmentRequest #save #1190

Closed stirkac closed 1 year ago

stirkac commented 1 year ago

Issue summary

When trying to request a Fulfilment, an error is raised, even though the response is successful and the Fulfilment Request is processed on Shopify.

fulfillment_request = ShopifyAPI::FulfillmentRequest.new(session: shop.session)
fulfillment_request.fulfillment_order_id = [REDACTED]
fulfillment_request.save

>        

/app/vendor/bundle/ruby/3.2.0/gems/sorbet-runtime-0.5.10910/lib/types/configuration.rb:296:in `call_validation_error_handler_default': Parameter 'data': Expected type T::Hash[String, T.untyped], got type NilClass (TypeError)
Caller: /app/vendor/bundle/ruby/3.2.0/gems/sorbet-runtime-0.5.10910/lib/types/private/methods/call_validation.rb:119
Definition: /app/vendor/bundle/ruby/3.2.0/gems/shopify_api-13.1.0/lib/shopify_api/rest/base.rb:229

    raise TypeError.new(opts[:pretty_message])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expected behavior

no Sorbet error should be raised

Actual behavior

Sorbet error is raised, falsely raising an error for otherwise successful API request

Steps to reproduce the problem

  1. (for Shopify devs): X-Request-Id 772fdeef-265f-462a-bbec-c3d1820ef865
  2. (for everyone else): create an order with third party fulfillment service, so the supported_actions on FulfillmentOrder include "request_fulfillment", then try to save a FulfillmentRequest for it