I’m attempting to use the Shopify Buy SDK to create a checkout and look up the available shipping rates for that checkout. How do I add the available shipping rates selection to the query? addConnection appears to be used for paginated data (like products, variants, or images).
const query = this.client.graphQLClient.query((root) => {
root.add('node', { args: {id: checkout_id} }, (node) => {
node.add('id');
node.addInlineFragmentOn('Checkout', (checkout) => {
checkout.add('totalPrice');
checkout.addConnection('availableShippingRates', (rate) => {
rate.add('title');
});
});
});
});
return this.client.graphQLClient.send(query).then(({ model, data }) => {
return data;
});
gives me the error:
ERROR Error: Uncaught (in promise): Error: No field of name “pageInfo” found on type “AvailableShippingRates” in schema
Error: No field of name “pageInfo” found on type “AvailableShippingRates” in schema