Shopify API Fulfillment Services issue: It returns an empty array

Highlighted
Shopify Expert
328 10 46

I was able to get fulfillment services using GraphQL, but there are memory leak issues (example issue filed on GitHub), so this isn't viable in production.

 

So I decided to use the REST API with the shopify_app Rails gem, but I'm getting an empty array.

 

Example code:

fulfillment_services = ShopifyAPI::FulfillmentService.all
puts fulfillment_services

This shows up as []

 

I know there are fulfillment services because manually retrieving with URL like this works:

https://store-name.myshopify.com/admin/api/2019-07/fulfillment_services.json

Any idea how to get the fulfillment services using the REST API in Rails?

 

Thanks.

 

Founder of Speed Boostr - we make Shopify sites faster.
Analyze your site at analyze.speedboostr.com.
I also build custom apps, systems, and automated solutions.
Enjoy the adventure!
0 Likes
Shopify Expert
3991 13 316

Interesting... I did a check on object

 

ShopifyAPI::FulfillmentService

and it exists. So I did a call to:

ShopifyAPI::FulfillmentService.count

and got a 400 error. I then did a call to

ShopifyAPI::FulfillmentService.all

and got back the 3 services I expected. Hooray for sort of consistent!

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Shopify Expert
328 10 46

Weeeeird. Thanks for checking though. I ended up sticking with GraphQL, found this shopify_graphql_client gem that helped relieve the memory leak issue I was facing. Good times.

Founder of Speed Boostr - we make Shopify sites faster.
Analyze your site at analyze.speedboostr.com.
I also build custom apps, systems, and automated solutions.
Enjoy the adventure!
0 Likes
Shopify Expert
3991 13 316

Yes. Michael worked for me, and was my summer intern a few summers ago. He does write nice code when the situation demands it. I still use his contributions regularily in my work. Send him some thanks!

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
1 Like