UNPKG

@shopify/graphql-client

Version:

Shopify GraphQL Client - A lightweight generic GraphQL JS client to interact with Shopify GraphQL APIs

24 lines (22 loc) 859 B
function generateGetHeaders(config) { return (customHeaders) => { return { ...(customHeaders ?? {}), ...config.headers }; }; } function generateGetGQLClientParams({ getHeaders, getApiUrl }) { return (operation, options) => { const props = [operation]; if (options && Object.keys(options).length > 0) { const { variables, apiVersion: propApiVersion, headers, retries } = options; props.push({ ...(variables ? { variables } : {}), ...(headers ? { headers: getHeaders(headers) } : {}), ...(propApiVersion ? { url: getApiUrl(propApiVersion) } : {}), ...(retries ? { retries } : {}), }); } return props; }; } export { generateGetGQLClientParams, generateGetHeaders }; //# sourceMappingURL=utilities.mjs.map