Introducing New GraphQL Product APIs in 2024-04

Apr 29, 20240 comments
GraphQL API image

GraphQL is a query language that lets developers request data from an API and then return only the requested data. The result is faster load times for end users, less server calls and more scalable apps. GraphQL also provides more flexible schemas than REST, and supports a variety of query optimizations like recursion and batching.

Introducing New GraphQL Product APIs

In 2024-04, we’re introducing new GraphQL variant capacity that allows merchants to handle more complex product catalogs with ease. This change is especially impactful for merchants who offer products in multiple colors, sizes or SKUs. The expanded variant capability will enable you to manage product variations and showcase options for your customers with ease, allowing you to build more robust and customizable e-commerce experiences.

We’re also launching a developer preview of defer directive, a tool that prioritizes parts of your GraphQL query to fetch the most critical information first. This improves performance and reduces the need for additional requests to fetch the remaining data, which could slow down your app.

For more details on how to use defer directive, check out our guide here.

New Error Messages

In our latest GraphQL update, we’ve improved error messages to provide more comprehensive info for a specific type of error. You can now see the exact line of code that caused an error, as well as helpful hints and tips for troubleshooting.

New GraphQL Admin API

In the winter of 2024, we’re introducing new GraphQL Admin API features to make it easier for merchants to manage their Shopify inventory and products. These new capabilities include support for combined listings facilitating the creation of subscription and recurring products with more flexible pricing and availability options, shipping discount functionality for creating and managing recurring product discounts, a dedicated webhook topic to send data from discount-related events for cross-channel syncing and detailed customer behavior insights, and a GraphQL function for order cancellation.

We’ve also added support for filtering GraphQL queries by their slug, which allows developers to create more concise and intuitive syntax. This is useful for developers whose GraphQL queries are often longer than the maximum query limit of 1000 slugs.

We’re continuing to invest in our infrastructure and ensuring your apps run fast and scale smoothly. With these new improvements, you can be confident your apps are built on the best possible technology and optimized to work well in any environment.