contentful API
Everything the package exports, by the path you import it from. Open an export for its signature and options.
@evolve-framework/contentful
ContentfulModule, the built-in content blocks and defineContentBlock for your own, the Contentful clients and configuration, and catalog page sync.
Classes
ContentfulModuleModule wiring Contentful resolvers, typedefs and webhook into a Domain Service.
import { ContentfulModule } from "@evolve-framework/contentful";Pass either a pre-built clients bundle (from createContentfulClients)
or a config object; the module will build its own clients from config
during init().
Only one ContentfulModule instance per process is supported — clients and the mapper registry are held as module-scope singletons.
Extends AbstractModule<ContentfulLoaderContext>
new ContentfulModule(options: ContentfulModuleOptions)| Option | Type | Description |
|---|---|---|
messagePublisher | MessagePublisher | Publisher used to emit |
webhookSecret | string | The signing secret of the space's webhook request verification, under Settings > Webhooks > Settings in Contentful. A delivery without a valid signature is refused with a 401. |
webhookPath? | string | URL path the webhook is registered on. Defaults to "/webhook". |
blocks? | ContentBlockDef[] | The complete set of content blocks the module serves. Defaults to the
built-in |
mappers? | ((registry: MapperRegistry) => void) | Optional callback invoked with the pre-populated MapperRegistry. Use it to add or override mappers for custom Contentful content types. |
articlesPerProduct? | number | How many articles a product shows at most. Defaults to 4. |
siteRevalidation? | SiteRevalidationOptions | The sites whose caches a publish purges: their revalidate URLs and the secret they share with this service. The locales purged are the space's. Without it the webhook purges only this service's caches. |
clients? | ContentfulClients | Clients the module uses as they are, typically from
|
config? | ContentfulConfig | Settings the module builds its own clients from with
|
MapperRegistryRegistry of mappers keyed by Contentful sys.contentType.sys.id.
import { MapperRegistry } from "@evolve-framework/contentful";Registering a mapper for an already-known content type overrides the previous registration without throwing. A block or column entry for other markets than the request's maps to nothing.
new MapperRegistry()| Method | Description |
|---|---|
registerBlock(
contentTypeId: string,
mapper: BlockMapper,
): this | |
registerColumnEntry(
contentTypeId: string,
mapper: ColumnEntryMapper,
): this | |
registerPage(contentTypeId: string, mapper: PageMapper): MapperRegistry | |
hasPage(contentTypeId: string): boolean | |
pageContentTypes(): string[] | The content types registered as pages, which are the ones a path routes to. |
mapBlock(context: ContextValue, entry: BaseEntry): Block | undefined | |
mapColumnEntry(
context: ContextValue,
entry: BaseEntry,
): ColumnEntry | undefined | |
mapPage(
context: ContextValue,
entry: BaseEntry,
options?: PageMapOptions,
): MappedPage | undefined | Map a page entry by its content type; answers undefined, and logs, for any other. |
StoreContextThe store, locale and currency a request is for, read from its X-StoreContext-* headers.
import { StoreContext } from "@evolve-framework/contentful";new StoreContext(storeContext: StoreContextInput)| Option | Type | Description |
|---|---|---|
currency | string | The currency used in the store context. |
locale | string | The locale of the store context. For example: en-US. |
storeKey | string | The store key associated with the store context. |
country? | InputMaybe<string> | The market the store context is for; leave out for every market. |
Functions
createContentfulClientsThe three clients for config, sharing one keep-alive HTTPS agent.
import { createContentfulClients } from "@evolve-framework/contentful";function createContentfulClients(config: ContentfulConfig): ContentfulClients| Option | Type | Description |
|---|---|---|
spaceId | string | |
environment | string | |
accessToken | string | |
previewToken | string | |
managementToken | string |
Returns ContentfulClients
defineContentBlockDefines a content block.
import { defineContentBlock } from "@evolve-framework/contentful";function defineContentBlock<TSkeleton, TOutput>( config: { id: string; typename: string; typeDefs?: string | undefined; terraform?: string | undefined; groups?: string[] | undefined; slots?: Record<string, Slot> | undefined; mapper: (context: ContextValue, entry: ContentfulEntry<TSkeleton>) => TOutput | undefined; },): ContentBlockDef & { mapper: ContentBlockMapper;}| Option | Type | Description |
|---|---|---|
id | string | |
typename | string | |
mapper | (context: ContextValue, entry: ContentfulEntry<TSkeleton>) => TOutput | undefined | |
typeDefs? | string | |
terraform? | string | |
groups? | string[] | |
slots? | Record<string, Slot> |
Returns ContentBlockDef & { mapper: ContentBlockMapper; }
generateTerraformAssembles the Terraform module as a single combined HCL string (the locals block followed by every block's Terraform).
import { generateTerraform } from "@evolve-framework/contentful";function generateTerraform(blocks: ContentBlockDef[]): stringReturns string
getContentfulClientsThe clients ContentfulModule set up; throws before one is constructed.
import { getContentfulClients } from "@evolve-framework/contentful";function getContentfulClients(): ContentfulClientsReturns ContentfulClients
getMapperRegistryThe registry ContentfulModule set up; throws before one is constructed.
import { getMapperRegistry } from "@evolve-framework/contentful";function getMapperRegistry(): MapperRegistryReturns MapperRegistry
mapArticleOverviewPageAn overview entry.
import { mapArticleOverviewPage } from "@evolve-framework/contentful";function mapArticleOverviewPage( options: { context: ContextValue; content: OverviewEntry; nested?: boolean | undefined; },): ArticleOverviewPage| Option | Type | Description |
|---|---|---|
context | ContextValue | |
content | OverviewEntry | |
nested? | boolean |
Returns ArticleOverviewPage
mapArticlePageAn article entry.
import { mapArticlePage } from "@evolve-framework/contentful";function mapArticlePage( options: { context: ContextValue; content: ArticleEntry; nested?: boolean | undefined; },): MappedArticlePage| Option | Type | Description |
|---|---|---|
context | ContextValue | |
content | ArticleEntry | |
nested? | boolean |
Returns MappedArticlePage
mapAssetA Contentful asset as a ContentAsset, its title as name and alt text, with the focal point the Focal Point app stored beside it, where there is one.
import { mapAsset } from "@evolve-framework/contentful";function mapAsset( content: Asset<"WITHOUT_UNRESOLVABLE_LINKS", string>, focalPoint?: FocalPointValue,): ContentAsset| Option | Type | Description |
|---|---|---|
focalPoint? | { x?: number | undefined; y?: number | undefined; } |
Returns ContentAsset
mapBlockSettingsThe settings every block of the content model carries: the anchor an in-page link points to, and who the block is shown to, everyone where unset.
import { mapBlockSettings } from "@evolve-framework/contentful";function mapBlockSettings( fields: { anchor?: string | undefined; audience?: string | undefined; },): { anchor: string | undefined; audience: AudienceType;}| Option | Type | Description |
|---|---|---|
anchor? | string | |
audience? | string |
Returns { anchor: string | undefined; audience: AudienceType; }
mapCategoriesA categories field as the categories the commerce subgraph resolves by key.
import { mapCategories } from "@evolve-framework/contentful";function mapCategories( keys: (string | undefined)[] | undefined,): ProductCategory[]Returns ProductCategory[]
mapFieldsThe entries mapped to blocks by the mapper registry; unmapped entries are dropped.
import { mapFields } from "@evolve-framework/contentful";function mapFields( context: ContextValue, fields: (BaseEntry | undefined)[] | undefined,): Block[]| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns Block[]
mapLinkValueMap a link entry onto Link.
import { mapLinkValue } from "@evolve-framework/contentful";function mapLinkValue( context: ContextValue, link: ContentfulEntry<TypeLinkSkeleton> | undefined,): Link | undefined| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns Link | undefined
mapLinkValuesMap a list of link entries, leaving out what is no link.
import { mapLinkValues } from "@evolve-framework/contentful";function mapLinkValues( context: ContextValue, links: (ContentfulEntry<TypeLinkSkeleton> | undefined)[] | undefined,): Link[]| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns Link[]
mapPageA page entry, by the page mapper registered for its content type; a project's own page type replaces the built-in of the same id.
import { mapPage } from "@evolve-framework/contentful";function mapPage( context: ContextValue, entry: BaseEntry, options?: PageMapOptions,): MappedPage | undefined| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext | |
nested? | boolean | Mapped inside another page, as its section or a related or featured article, so it leaves out what can lead back to that page. |
Returns MappedPage | undefined
mapPromoMap a promo entry onto Promo; one without a title is no promo.
import { mapPromo } from "@evolve-framework/contentful";function mapPromo( context: ContextValue, promo: ContentfulEntry<TypePromoSkeleton> | undefined,): Promo | undefined| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns Promo | undefined
mapPromosMap a list of promo entries, leaving out what is no promo.
import { mapPromos } from "@evolve-framework/contentful";function mapPromos( context: ContextValue, promos: (ContentfulEntry<TypePromoSkeleton> | undefined)[] | undefined,): Promo[]| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns Promo[]
mapRichTextA plain text field as rich text: one paragraph, a line break kept as a hardBreak.
import { mapRichText } from "@evolve-framework/contentful";function mapRichText( data: string | undefined, id?: string,): RichText | undefinedReturns RichText | undefined
mapRichTextDocumentA rich text field's document as the vendor-neutral tree, or undefined where it holds no text.
import { mapRichTextDocument } from "@evolve-framework/contentful";function mapRichTextDocument( document: unknown, id: string, context?: ContextValue,): RichText | undefined| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns RichText | undefined
mapRichTextFieldA rich text entry's document as the vendor-neutral tree.
import { mapRichTextField } from "@evolve-framework/contentful";function mapRichTextField( data: AnyEntry, context?: ContextValue,): RichText | undefined| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns RichText | undefined
mapSeoMetaA page's metadata from its three SEO fields, the same in every CMS.
import { mapSeoMeta } from "@evolve-framework/contentful";function mapSeoMeta(fields: SeoEntryFields): PageMeta | undefined| Option | Type | Description |
|---|---|---|
seoTitle? | string | |
seoDescription? | string | |
seoImage? | Asset<"WITHOUT_UNRESOLVABLE_LINKS", string> |
Returns PageMeta | undefined
mapUspMap a USP, for a USP list and for the site's header bar; one without text is no USP.
import { mapUsp } from "@evolve-framework/contentful";function mapUsp( context: ContextValue, usp: ContentfulEntry<TypeUspSkeleton> | undefined,): Usp | undefined| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns Usp | undefined
mapUspsMap a list of USPs, leaving out what is no USP.
import { mapUsps } from "@evolve-framework/contentful";function mapUsps( context: ContextValue, usps: (ContentfulEntry<TypeUspSkeleton> | undefined)[] | undefined,): Usp[]| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns Usp[]
pagePathsOfThe paths of the page entry id, from the route index the request loaded.
import { pagePathsOf } from "@evolve-framework/contentful";function pagePathsOf(context: ContextValue, id: string): PagePaths| Option | Type | Description |
|---|---|---|
loaders | { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fields: { title?: string | undefined; description… | |
storeContext? | StoreContext |
Returns PagePaths
terraformFilesAssembles the Terraform module as a set of files: a generated block_locals.tf (whitelist locals from group membership) plus one block_<snake id>.tf per block that carries Terraform.
import { terraformFiles } from "@evolve-framework/contentful";The generated file is named block_locals.tf rather than locals.tf so it
sits alongside a consumer's own hand-owned locals.tf (provider/space
config, locales, …) — Terraform merges the two locals blocks.
function terraformFiles(blocks: ContentBlockDef[]): TerraformFile[]Returns TerraformFile[]
toAudienceA stored audience option as the schema's enum; EVERYONE when unset or unknown.
import { toAudience } from "@evolve-framework/contentful";function toAudience(value: string | undefined): AudienceTypeReturns AudienceType
toColumnsRatioA stored columns ratio option as the schema's enum; fallback when unset or unknown.
import { toColumnsRatio } from "@evolve-framework/contentful";function toColumnsRatio( value: string | undefined, fallback: ColumnsRatioType,): ColumnsRatioTypeReturns ColumnsRatioType
toResourceLinkA link drawn as the ResourceLink Usp still carries: a page by its path, a product by its SKU and a URL as external.
import { toResourceLink } from "@evolve-framework/contentful";function toResourceLink(link: Link | undefined): ResourceLink | undefined| Option | Type | Description |
|---|---|---|
label | string | The visible text. |
variant | LinkVariantType | How prominently the link is drawn. |
__typename? | "Link" | |
page? | Maybe<ArticleOverviewPage | ArticlePage | CatalogPage | ContentPage> | The page it opens. |
product? | Maybe<ProductVariant> | The product it opens, as the variant the editor picked by its sku; the variant's product links to its page. |
route? | Maybe<StorefrontRouteType> | The storefront route it opens, such as the cart. |
url? | Maybe<string> | The URL it opens, for a target outside the site. |
Returns ResourceLink | undefined
upsertCatalogPageCreate the catalog page for a category, below its parent category's page where that keeps the engine's path, so the page's path follows the tree.
import { upsertCatalogPage } from "@evolve-framework/contentful";Returns what it did, so a backfill can report rather than guess. A category that already has an entry is left alone: what arrives here is a category, not a page — no hero, no copy, no meta — and everything beyond that is an editor's to fill in.
The space's locales are read per call rather than cached, so a locale added in Contentful takes effect without restarting the service; a field written for a locale the space does not have is refused outright.
function upsertCatalogPage( input: CatalogPageInput,): Promise<"created" | "unchanged">| Option | Type | Description |
|---|---|---|
categoryId | string | The engine's category id. The join key the catalog subgraph resolves on. |
name | Record<string, string> | Category name per locale, e.g. |
path | string | Record<string, string> | The path the storefront routes, which the page's path keeps. Per locale where the engine translates its slugs, or one string when it does not. |
parentCategoryId? | string | The parent category's id, whose page becomes the page's parent. |
description? | Record<string, string> | Category description per locale, where the engine has one. |
Returns Promise<"created" | "unchanged">
writeTerraformWrites the assembled Terraform module for blocks to outputDir (created if needed): a generated locals.tf plus one <block id>.tf per block.
import { writeTerraform } from "@evolve-framework/contentful";Only resource/locals blocks are emitted — provider, backend and
required_providers config are the consumer's to own.
function writeTerraform(blocks: ContentBlockDef[], outputDir: string): string[]Returns string[]
Constants
blocksBuilt-in content blocks keyed by their Contentful content-type id.
import { blocks } from "@evolve-framework/contentful";const blocks: Record<string, ContentBlockDef>contentBlocksBuilt-in content blocks.
import { contentBlocks } from "@evolve-framework/contentful";const contentBlocks: ContentBlockDef[]contentfulDataLoadersThe Contentful loaders a module declares, built per request from it.
import { contentfulDataLoaders } from "@evolve-framework/contentful";const contentfulDataLoaders: DataLoaderDefinition<ContentfulLoaderContext, { catalogPageById: DataLoader<string, (BaseEntry & { sys: { contentType: { sys: { id: "catalog_page"; }; }; }; fie…pageTypesThe built-in page types.
import { pageTypes } from "@evolve-framework/contentful";const pageTypes: ContentBlockDef[]Types
BlockMapperMaps an entry to a page block, or undefined to leave it out.
import { type BlockMapper } from "@evolve-framework/contentful";export type BlockMapper = (context: ContextValue, entry: BaseEntry) => Block | undefined;ColumnEntryMapperMaps an entry to a column entry, or undefined to leave it out.
import { type ColumnEntryMapper } from "@evolve-framework/contentful";export type ColumnEntryMapper = (context: ContextValue, entry: BaseEntry) => ColumnEntry | undefined;ContentBlockDefA content block bundles everything one Contentful content type needs: its output typename, SDL fragment, mapper (Contentful entry -> GraphQL type), the Terraform that provisions it, and its composition metadata (which groups it belongs to, and which slots it exposes).
import { type ContentBlockDef } from "@evolve-framework/contentful";A block references other blocks only by id/group — never by import — so any single block can be ejected while still referencing the ones left behind.
export type ContentBlockDef = { id: string; typename: string; typeDefs?: string; terraform?: string; groups?: GroupId[]; slots?: Record<string, Slot>; mapper?: ContentBlockMapper; pageMapper?: PageMapper;};ContentfulClientsThe delivery, preview and management clients for one space and environment.
import { type ContentfulClients } from "@evolve-framework/contentful";export type ContentfulClients = { client: ContentfulClientApi<undefined>; previewClient: ContentfulClientApi<undefined>; managementClient: PlainClientAPI; spaceId: string; environment: string;};ContentfulEntryAn entry of skeleton T, read with unresolvable links left out.
import { type ContentfulEntry } from "@evolve-framework/contentful";export type ContentfulEntry<T extends EntrySkeletonType> = Entry<T, "WITHOUT_UNRESOLVABLE_LINKS", string>;ContentfulLoaderContextWhat these loaders read off the request context.
import { type ContentfulLoaderContext } from "@evolve-framework/contentful";export type ContentfulLoaderContext = { request: Request;};ContextValueThe GraphQL context the Contentful resolvers read.
import { type ContextValue } from "@evolve-framework/contentful";export type ContextValue = { storeContext?: StoreContext; loaders: ReturnType<typeof createDataLoaders>;};DataLoadersThe Contentful loaders of one request.
import { type DataLoaders } from "@evolve-framework/contentful";export type DataLoaders = ReturnType<typeof contentfulDataLoaders.create>;FocalPointValueWhat the Focal Point app stores beside an image: a point in its pixels.
import { type FocalPointValue } from "@evolve-framework/contentful";export type FocalPointValue = { focalPoint?: { x?: number; y?: number; };};GroupIdA slot-group: a named set of blocks that can fill a slot.
import { type GroupId } from "@evolve-framework/contentful";export type GroupId = string;MappedPageEach concrete page type, so a resolver can return any of them as a page.
import { type MappedPage } from "@evolve-framework/contentful";export type MappedPage = ArticleOverviewPage | ArticlePage | CatalogPage | ContentPage;PageMapperMaps an entry of a page type onto its GraphQL page.
import { type PageMapper } from "@evolve-framework/contentful";export type PageMapper = (context: ContextValue, entry: BaseEntry, options?: PageMapOptions) => MappedPage;PagePathsA page's path in the request's locale and in every locale it has one.
import { type PagePaths } from "@evolve-framework/contentful";export type PagePaths = { path: string; translatedPaths: TranslatedPath[];};SlotA named containment point a block exposes.
import { type Slot } from "@evolve-framework/contentful";export type Slot = { accepts: SlotAccepts;};SlotAcceptsWhat a slot accepts.
import { type SlotAccepts } from "@evolve-framework/contentful";export type SlotAccepts = GroupId | { group?: GroupId; ids?: string[];};TerraformFileA single generated Terraform file: its name and HCL contents.
import { type TerraformFile } from "@evolve-framework/contentful";export type TerraformFile = { filename: string; content: string;};@evolve-framework/contentful/graphql/context
The request context the module's resolvers expect.
Classes
StoreContextThe store, locale and currency a request is for, read from its X-StoreContext-* headers.
import { StoreContext } from "@evolve-framework/contentful/graphql/context";new StoreContext(storeContext: StoreContextInput)| Option | Type | Description |
|---|---|---|
currency | string | The currency used in the store context. |
locale | string | The locale of the store context. For example: en-US. |
storeKey | string | The store key associated with the store context. |
country? | InputMaybe<string> | The market the store context is for; leave out for every market. |
Functions
initContextValueThe context for a request: its store context and the data loaders.
import { initContextValue } from "@evolve-framework/contentful/graphql/context";function initContextValue({ request }: YogaInitialContext): ContextValueReturns ContextValue
Types
ContextValueThe GraphQL context the Contentful resolvers read.
import { type ContextValue } from "@evolve-framework/contentful/graphql/context";export type ContextValue = { storeContext?: StoreContext; loaders: ReturnType<typeof createDataLoaders>;};@evolve-framework/contentful/graphql/types
The generated GraphQL types of the content contract.
Generated types236Generated from the schema, one per type.
ArticleList | Article cards: the articles the editor picked, or else the newest that match its filters on section, topic and category. |
ArticleListResolvers | |
ArticleOverviewPage | The overview of one section of articles, such as a blog or the buying guides. |
ArticleOverviewPageResolvers | |
ArticlePage | An article, such as a blog post, a buying guide or a news item: a page whose text owns it. |
ArticlePageResolvers | |
ArticleResult | One page of articles, newest first. |
ArticleResultResolvers | |
AudienceType | Who a block is shown to. |
Author | Who wrote an article, as the byline and the author markup name them. |
AuthorResolvers | |
Block | Rich text is also a block of its own, placed directly in a page body. |
BlockResolvers | |
Brand | A brand. |
BrandList | Brand logos that link to their brand pages, in the order the editor placed them. |
BrandListResolvers | |
BrandResolvers | |
Breadcrumb | Represents a single item in a breadcrumb trail. |
BreadcrumbResolvers | |
BreadcrumbType | Represents different types of breadcrumbs in the navigation structure. |
CampaignBanner | A campaign: an image with the text beside it, not on it, and one call to action. |
CampaignBannerResolvers | |
CatalogPage | Represents a product listing page with its surrounding content. |
CatalogPageFacetFilter | One facet of a curated collection and the values it selects. |
CatalogPageFacetFilterInput | One facet of a listing's filter and the values it selects. |
CatalogPageFacetFilterResolvers | |
CatalogPageLayoutType | How a catalog page presents its category. |
CatalogPageResolvers | |
CategoryList | Entrances to categories: the ones the editor picked, or the children of one category. |
CategoryListResolvers | |
ColumnEntry | Represents content types that can be used in columns. |
ColumnEntryResolvers | |
Columns | Two to four blocks side by side, stacked in their order on a narrow screen. |
ColumnsRatioType | How the width is shared between two columns, in the order they are placed. |
ColumnsResolvers | |
ContentAsset | Represents a content asset, such as an image or file. |
ContentAssetResolvers | |
ContentPage | Represents a content page with various sections and blocks. |
ContentPageResolvers | |
ContentSearchHit | A page or an article that matches a search. |
ContentSearchHitResolvers | |
ContentSearchResult | What the CMS answers to a search term. |
ContentSearchResultResolvers | |
ContentSnippet | Represents a snippet of content that can be used in various places. |
ContentSnippetResolvers | |
ContentTeaser | An image beside text, or text alone, with up to two links. |
ContentTeaserResolvers | |
ContentVersionType | Specifies different versions of content. |
CountryCodeScalarConfig | |
CurrencyScalarConfig | |
DateScalarConfig | |
DateTimeScalarConfig | |
DirectiveResolverFn | |
DirectiveResolvers | |
EmailAddressScalarConfig | |
Error | Shared interface for every error returned as data. |
ErrorResolvers | |
Faq | |
FaqGroup | |
FaqGroupResolvers | |
FaqItem | |
FaqItemResolvers | |
FaqResolvers | |
FederationReferenceTypes | Mapping of federation reference types |
FederationTypes | Mapping of federation types |
FieldValidationIssue | A single field-level validation failure, to attach to its input control |
FieldValidationIssueResolvers | |
Figure | One key figure: a value with what it measures. |
FigureList | Two to four key figures. |
FigureListResolvers | |
FigureResolvers | |
FocalPoint | A point in an image, in percent from its left and top edges. |
FocalPointResolvers | |
GraphQLRecursivePick | |
Hotspot | One product pinned on a shoppable image. |
HotspotResolvers | |
Image | One image, or a pair side by side. |
ImageResolvers | |
InputMaybe | |
IsTypeOfResolverFn | |
JsonScalarConfig | |
Link | A link with its own label, to one target: a page, a product, a storefront route or a URL. |
LinkKindType | What a resolved link points at: a page of the site, or a URL. |
LinkResolvers | |
LinkVariantType | How prominently a link is drawn. |
LocaleScalarConfig | |
Maybe | |
MenuItem | One menu entry: a link, or a heading for the entries below it. |
MenuItemResolvers | |
Messages | The store's fixed system copy, one entry per store, for the places no editor fills by hand. |
MessagesResolvers | |
Mutation | Defines the available mutations in the schema. |
MutationResolvers | |
MutationStoreContentPreviewArgs | Defines the available mutations in the schema. |
Navigation | A menu: the header's, the footer's, or one of the project's own. |
NavigationResolvers | |
NextResolverFn | |
Omit | |
OpenGraph | Open Graph protocol metadata for social media sharing |
OpenGraphResolvers | |
Page | A page a route can land on. |
PageMeta | Page metadata for SEO, from the page's three SEO fields. |
PageMetaResolvers | |
PageRedirect | Where a path sends a visitor: written by an editor, or by the CMS when a page's path changed, from the old path to the page. |
PageRedirectResolvers | |
PageResolvers | |
PageSortOrderType | Specifies sorting options for pages. |
PagesResult | Represents the result of a query for multiple pages. |
PagesResultResolvers | |
PageType | Defines the different types of pages available in the system. |
Pagination | Where a page sits within the full result set. |
PaginationResolvers | |
PaymentBrandType | A way to pay the store accepts, which the site draws as that brand's logo. |
Product | Product entity containing all product information, variants, and metadata. |
ProductCategory | Represents a category of products. |
ProductCategoryResolvers | |
ProductList | Products, either the variants the editor picked or those a source selects. |
ProductListResolvers | |
ProductResolvers | |
ProductSortOrderType | Available sorting options for product listings |
ProductSource | Which products a listing shows: those in a category, narrowed by facet selections, in a sort order. |
ProductSourceFilter | One facet of a product source and the values it selects. |
ProductSourceFilterResolvers | |
ProductSourceResolvers | |
ProductVariant | |
ProductVariantResolvers | |
Promo | A card that links somewhere. |
PromoList | Two to four promo cards side by side. |
PromoListResolvers | |
PromoResolvers | |
Query | Defines the available queries in the schema. |
QueryArticlesArgs | Defines the available queries in the schema. |
QueryCatalogPageArgs | Defines the available queries in the schema. |
QueryCatalogPageByFilterArgs | Defines the available queries in the schema. |
QueryContentPageArgs | Defines the available queries in the schema. |
QueryContentSearchArgs | Defines the available queries in the schema. |
QueryContentSnippetArgs | Defines the available queries in the schema. |
QueryMessagesArgs | Defines the available queries in the schema. |
QueryPageArgs | Defines the available queries in the schema. |
QueryPagesArgs | Defines the available queries in the schema. |
QueryRedirectArgs | Defines the available queries in the schema. |
QueryResolvers | |
QuerySiteArgs | Defines the available queries in the schema. |
QuerySiteSettingsArgs | Defines the available queries in the schema. |
ReferenceResolver | |
RequireFields | |
RequiresSessionDirectiveArgs | |
RequiresSessionDirectiveResolver | |
Resolver | |
ResolverFn | |
Resolvers | |
ResolversInterfaceTypes | Mapping of interface types |
ResolversParentTypes | Mapping between all available schema types and the resolvers parents |
ResolversTypes | Mapping between all available schema types and the resolvers types |
ResolversUnionTypes | Mapping of union types |
ResolverTypeWrapper | |
ResourceLink | Represents a link to a resource, either internal or external. |
ResourceLinkResolvers | |
ResourceLinkType | Specifies different types of resource links. |
RichText | Formatted text, the same whichever CMS wrote it. |
RichTextEmbed | What rich text can embed. |
RichTextEmbedResolvers | |
RichTextImageEmbed | An image placed in rich text. |
RichTextImageEmbedResolvers | |
RichTextLink | A link in rich text, resolved by the adapter. |
RichTextLinkResolvers | |
RichTextProductEmbed | A product placed in rich text, by its sku. |
RichTextProductEmbedResolvers | |
RichTextPromoEmbed | A promo placed in rich text. |
RichTextPromoEmbedResolvers | |
RichTextResolvers | |
RichTextShoppableImageEmbed | A shoppable image placed in rich text. |
RichTextShoppableImageEmbedResolvers | |
RichTextTipEmbed | A tip placed in rich text. |
RichTextTipEmbedResolvers | |
RichTextVideoEmbed | A video placed in rich text. |
RichTextVideoEmbedResolvers | |
Scalars | All built-in and custom scalars, mapped to their actual values |
SearchRedirect | Where a keyword rule sends a search instead of to a result page. |
SearchRedirectResolvers | |
ShareableDirectiveArgs | |
ShareableDirectiveResolver | |
ShoppableImage | One image with two to six products pinned on it, also listed beside or below it. |
ShoppableImageResolvers | |
Site | The store's settings, one per store: its menus, the selling points in the header bar, its social profiles, payment brands and review rating, and the templates the SEO title and description of a page fall back to. |
SiteResolvers | |
SiteSettings | Which page of the site answers each recurring purpose, such as the contact or the returns page, one entry per store. |
SiteSettingsResolvers | |
SocialLink | The store's profile on a social network; the site draws the network's icon. |
SocialLinkResolvers | |
SocialPlatformType | A social network a store keeps a profile on. |
Step | One step of a step list. |
StepList | Two to four numbered steps, such as how an account, a return or a job works. |
StepListResolvers | |
StepResolvers | |
StoreContentPreviewData | Represents data for storing content previews. |
StoreContentPreviewDataResolvers | |
StoreContentPreviewError | |
StoreContentPreviewErrorResolvers | |
StoreContentPreviewResponse | |
StoreContentPreviewResponseResolvers | |
StoreContext | |
StoreContextResolvers | |
StorefrontRouteType | A page the storefront itself serves rather than the CMS. |
SubscriptionObject | |
SubscriptionResolveFn | |
SubscriptionResolver | |
SubscriptionResolverObject | |
SubscriptionSubscribeFn | |
SubscriptionSubscriberObject | |
TableOfContents | Links to the anchors on the page. |
TableOfContentsResolvers | |
TimeScalarConfig | |
Tip | A highlighted tip, in a page body or inside rich text. |
TipResolvers | |
Topic | What an article is about, such as tennis or maintenance. |
TopicPage | A topic's page below a section of articles. |
TopicPageResolvers | |
TopicResolvers | |
TranslatedPath | Represents a translated path for a specific locale. |
TranslatedPathResolvers | |
TrustRating | The store's average review score at a review service, such as 9.2 out of 10 from 1,284 reviews, as an editor entered it. |
TrustRatingResolvers | |
TypeResolveFn | |
UrlScalarConfig | |
Usp | Represents a single Unique Selling Point (USP). |
UspIconType | The icon a selling point shows, from a fixed set the storefront maps to its own glyphs. |
UspList | The store's selling points, two to six of them. |
UspListResolvers | |
UspResolvers | |
ValidationError | The input was malformed: one or more fields need editing before the operation can succeed. |
ValidationErrorResolvers | |
Video | A YouTube video, played from the privacy-enhanced domain once the visitor consents. |
VideoResolvers | |
YoutubeVideo | A YouTube video embedded in rich text. |
YoutubeVideoResolvers |
@evolve-framework/contentful/cftypes
Generated TypeScript types of the Contentful content types the module provisions.
Functions
isTypeContentSnippet
import { isTypeContentSnippet } from "@evolve-framework/contentful/cftypes";function isTypeContentSnippet<Modifiers, Locales>( entry: Entry<EntrySkeletonType, Modifiers, Locales>,): entry is TypeContentSnippet<Modifiers, Locales>Returns entry is TypeContentSnippet<Modifiers, Locales>
isTypeFaqItem
import { isTypeFaqItem } from "@evolve-framework/contentful/cftypes";function isTypeFaqItem<Modifiers, Locales>( entry: Entry<EntrySkeletonType, Modifiers, Locales>,): entry is TypeFaqItem<Modifiers, Locales>Returns entry is TypeFaqItem<Modifiers, Locales>
isTypeImage
import { isTypeImage } from "@evolve-framework/contentful/cftypes";function isTypeImage<Modifiers, Locales>( entry: Entry<EntrySkeletonType, Modifiers, Locales>,): entry is TypeImage<Modifiers, Locales>Returns entry is TypeImage<Modifiers, Locales>
isTypePageCatalog
import { isTypePageCatalog } from "@evolve-framework/contentful/cftypes";function isTypePageCatalog<Modifiers, Locales>( entry: Entry<EntrySkeletonType, Modifiers, Locales>,): entry is TypePageCatalog<Modifiers, Locales>Returns entry is TypePageCatalog<Modifiers, Locales>
isTypePageContent
import { isTypePageContent } from "@evolve-framework/contentful/cftypes";function isTypePageContent<Modifiers, Locales>( entry: Entry<EntrySkeletonType, Modifiers, Locales>,): entry is TypePageContent<Modifiers, Locales>Returns entry is TypePageContent<Modifiers, Locales>
isTypeRichText
import { isTypeRichText } from "@evolve-framework/contentful/cftypes";function isTypeRichText<Modifiers, Locales>( entry: Entry<EntrySkeletonType, Modifiers, Locales>,): entry is TypeRichText<Modifiers, Locales>Returns entry is TypeRichText<Modifiers, Locales>
Generated types107Generated from the schema, one per type.
TypeArticleListFields | Fields of the articleList content type. |
TypeArticleListSkeleton | |
TypeAuthorSkeleton | |
TypeBrandListFields | Fields of the brandList content type. |
TypeBrandListSkeleton | |
TypeCampaignBannerFields | Fields of the campaign_banner content type. |
TypeCampaignBannerSkeleton | |
TypeCategoryListFields | |
TypeCategoryListSkeleton | |
TypeColumnsFields | Fields of the columns content type. |
TypeColumnsSkeleton | |
TypeContentSnippet | Entry type definition for content type 'content_snippet' (Content Snippet) |
TypeContentSnippetFields | Fields type definition for content type 'TypeContentSnippet' |
TypeContentSnippetSkeleton | Entry skeleton type definition for content type 'content_snippet' (Content Snippet) |
TypeContentSnippetWithAllLocalesAndWithoutLinkResolutionResponse | |
TypeContentSnippetWithAllLocalesAndWithoutUnresolvableLinksResponse | |
TypeContentSnippetWithAllLocalesResponse | |
TypeContentSnippetWithoutLinkResolutionResponse | |
TypeContentSnippetWithoutUnresolvableLinksResponse | |
TypeContentTeaserFields | Fields of the content_teaser content type. |
TypeContentTeaserSkeleton | |
TypeFaqFields | |
TypeFaqItem | Entry type definition for content type 'faq_item' (FAQ Item) |
TypeFaqItemFields | Fields type definition for content type 'TypeFaqItem' |
TypeFaqItemSkeleton | Entry skeleton type definition for content type 'faq_item' (FAQ Item) |
TypeFaqItemWithAllLocalesAndWithoutLinkResolutionResponse | |
TypeFaqItemWithAllLocalesAndWithoutUnresolvableLinksResponse | |
TypeFaqItemWithAllLocalesResponse | |
TypeFaqItemWithoutLinkResolutionResponse | |
TypeFaqItemWithoutUnresolvableLinksResponse | |
TypeFaqSkeleton | |
TypeFigureFields | Fields of the figure content type. |
TypeFigureListFields | Fields of the figure_list content type. |
TypeFigureListSkeleton | |
TypeFigureSkeleton | |
TypeHotspotFields | Fields of the hotspot content type. |
TypeHotspotSkeleton | |
TypeImage | Entry type definition for content type 'image' (Image) |
TypeImageFields | Fields type definition for content type 'TypeImage' |
TypeImageSkeleton | Entry skeleton type definition for content type 'image' (Image) |
TypeImageWithAllLocalesAndWithoutLinkResolutionResponse | |
TypeImageWithAllLocalesAndWithoutUnresolvableLinksResponse | |
TypeImageWithAllLocalesResponse | |
TypeImageWithoutLinkResolutionResponse | |
TypeImageWithoutUnresolvableLinksResponse | |
TypeLinkFields | Fields of the link content type. |
TypeLinkSkeleton | |
TypeMenuItemFields | Fields of the menu_item content type. |
TypeMenuItemSkeleton | |
TypeMessagesFields | Fields of the messages content type. |
TypeMessagesSkeleton | |
TypeNavigationFields | Fields of the navigation content type. |
TypeNavigationSkeleton | |
TypePageArticleFields | Fields of the pageArticle content type. |
TypePageArticleOverviewFields | Fields of the pageArticleOverview content type. |
TypePageArticleOverviewSkeleton | |
TypePageArticleSkeleton | |
TypePageCatalog | Entry type definition for content type 'catalog_page' (Product Catalog Page) |
TypePageCatalogFields | Fields type definition for content type 'TypePageCatalog' |
TypePageCatalogSkeleton | Entry skeleton type definition for content type 'catalog_page' (Product Catalog Page) |
TypePageCatalogWithAllLocalesAndWithoutLinkResolutionResponse | |
TypePageCatalogWithAllLocalesAndWithoutUnresolvableLinksResponse | |
TypePageCatalogWithAllLocalesResponse | |
TypePageCatalogWithoutLinkResolutionResponse | |
TypePageCatalogWithoutUnresolvableLinksResponse | |
TypePageContent | Entry type definition for content type 'content_page' (Content Page) |
TypePageContentFields | Fields type definition for content type 'TypePageContent' |
TypePageContentSkeleton | Entry skeleton type definition for content type 'content_page' (Content Page) |
TypePageContentWithAllLocalesAndWithoutLinkResolutionResponse | |
TypePageContentWithAllLocalesAndWithoutUnresolvableLinksResponse | |
TypePageContentWithAllLocalesResponse | |
TypePageContentWithoutLinkResolutionResponse | |
TypePageContentWithoutUnresolvableLinksResponse | |
TypeProductListFields | Fields of the product_list content type. |
TypeProductListSkeleton | |
TypePromoFields | Fields of the promo content type. |
TypePromoListFields | Fields of the promo_list content type. |
TypePromoListSkeleton | |
TypePromoSkeleton | |
TypeRichText | Entry type definition for content type 'rich_text' (Rich Text) |
TypeRichTextFields | Fields type definition for content type 'TypeRichText' |
TypeRichTextSkeleton | Entry skeleton type definition for content type 'rich_text' (Rich Text) |
TypeRichTextWithAllLocalesAndWithoutLinkResolutionResponse | |
TypeRichTextWithAllLocalesAndWithoutUnresolvableLinksResponse | |
TypeRichTextWithAllLocalesResponse | |
TypeRichTextWithoutLinkResolutionResponse | |
TypeRichTextWithoutUnresolvableLinksResponse | |
TypeShoppableImageFields | Fields of the shoppable_image content type. |
TypeShoppableImageSkeleton | |
TypeSiteFields | Fields of the site content type. |
TypeSiteSkeleton | |
TypeSocialLinkSkeleton | |
TypeStepFields | Fields of the step content type. |
TypeStepListFields | Fields of the step_list content type. |
TypeStepListSkeleton | |
TypeStepSkeleton | |
TypeTableOfContentsFields | Fields of the tableOfContents content type. |
TypeTableOfContentsSkeleton | |
TypeTipFields | Fields of the tip content type. |
TypeTipSkeleton | |
TypeTopicSkeleton | |
TypeUspFields | Fields of the usp content type. |
TypeUspListFields | Fields of the usp_list content type. |
TypeUspListSkeleton | |
TypeUspSkeleton | |
TypeVideoFields | |
TypeVideoSkeleton |
Not listed: 5 options types. They appear as the tables under the constructors and functions they type.

