New GraphQL API and the Shopify Python Library?

I’ve been reading about the new GraphQL API and I’m not quite sure what that means for Shopify’s Python API. According to the GitHub repository, it relies heavily on the pyactiveresource library, which maps to the REST webservices resources. Should my custom app be migrated or what am I expected to do now?

Hello @casadev

You will no longer be able to use the REST wrappers. You will have to use the GQL client: https://github.com/Shopify/shopify_python_api?tab=readme-ov-file#graphql

1 Like

Are there plans to migrate the REST wrappers to GQL? Being able to use shopify.Product.find(ID), product.title = TITLE, etc. is extremely helpful and significantly improves readability as opposed to the queries that’ll span many lines.

Of course I don’t expect this to happen immediately, I’m just curious if there are plans to migrate.

We just went ahead and created custom classes that emulate the REST Admin wrappers so that we can at least interact with GQL objects more easily. Having to type or copy/paste string fields each time when you define a new method/function is very tiresome and error-prone.

Create these classes for common objects that you frequently interact with (product, productVariant, metafield, etc.).