import { ApolloQueryResult } from "@apollo/client/core"; import type { CustomHeaders } from "@vue-storefront/magento-types"; import { CmsBlockQuery, CustomQuery } from "@vue-storefront/magento-types"; import { Context } from "../../types/context"; /** * Fetch cms blocks. * * @example * Simple usage: * ```ts * import { sdk } from '~/sdk.config.ts'; * * // fetch few cms blocks by their identifiers * const { data } = await sdk.magento.cmsBlocks({ * identifiers: ['id1', 'id2'] * }); * * // result will contain cms blocks with the specified identifiers * data.cmsBlocks.items.forEach(block => console.log(block.identifier)); * ``` * * @example * Creating a custom GraphQL query * * ```ts * module.exports = { * integrations: { * magento: { * customQueries: { * 'cms-blocks-custom-query': ({ variables, metadata }) => ({ * variables, * query: ` * query cmsBlock($identifiers: [String]) { * cmsBlocks(identifiers: $identifiers) { * items { * ${metadata.fields} * } * } * } * ` * }), * }, * } * } * }; * ``` * * @example * Using a custom GraphQL query to reduce the amount of fields returned by the query * * ```ts * import { sdk } from '~/sdk.config.ts'; * // reduce the amount of fields returned by the query, when compared to the default query * // fetch only title * const customQuery = { * cmsBlocks: 'cms-blocks-custom-query', * metadata: { * fields: 'title' * } * }; * * const { data } = await sdk.magento.cmsBlocks({ * identifiers: ['id1', 'id2'] * }, customQuery); * * // data will contain only block titles * ``` */ export declare function cmsBlocks(context: Context, identifiers: string, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise>; //# sourceMappingURL=index.d.ts.map