The clientProvider abstraction has gotten a makeover to simplify the API. Instead of exposting graphqlClient and restClient functions, it now has a namespace that contains both online and offline objects. Each object contains a graphqlClient and restClient function that can be used to create a client for the respective access mode.
import clientProvider from "@/utils/clientProvider";
const { client, shop, session } = await clientProvider.online.graphqlClient({
req,
res,
});
const { client, shop, session } = await clientProvider.online.restClient({
req,
res,
});import clientProvider from "@/utils/clientProvider";
const { client, shop, session } = await clientProvider.offline.graphqlClient({
shop: req.user_shop,
});
const { client, shop, session } = await clientProvider.offline.restClient({
shop: req.user_shop,
});- Head into
verifyRequestand add inreq.user_shop = session.shopafterreq.user_session = session;. - Update your
graphqlClientandrestClientcalls toclientProvider.online.graphqlClient/clientProvider.offline.graphqlClientandclientProvider.online.restClient/clientProvider.offline.restClient