Skip to content

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)
OptionTypeDescription
messagePublisherMessagePublisher

Publisher used to emit content-modified events from the webhook. Pass a messagePublisher from a cloud adapter (e.g. new SqsPublisher(...)) or a NoopPublisher to disable publishing.

webhookSecretstring

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 contentBlocks; spread it to add or replace, e.g. blocks: [...contentBlocks, myBlock] (a block whose id matches a built-in replaces it). Each block's mapper is registered and its SDL fragment merged into the served schema.

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 createContentfulClients. Pass either this or config.

config?ContentfulConfig

Settings the module builds its own clients from with createContentfulClients during init(). Pass either this or clients.

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()
MethodDescription
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 | undefinedMap 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)
OptionTypeDescription
currencystring

The currency used in the store context.

localestring

The locale of the store context. For example: en-US.

storeKeystring

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
OptionTypeDescription
spaceIdstring
environmentstring
accessTokenstring
previewTokenstring
managementTokenstring

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;
}
OptionTypeDescription
idstring
typenamestring
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[]): string

Returns string

getContentfulClientsThe clients ContentfulModule set up; throws before one is constructed.
import { getContentfulClients } from "@evolve-framework/contentful";
function getContentfulClients(): ContentfulClients

Returns ContentfulClients

getMapperRegistryThe registry ContentfulModule set up; throws before one is constructed.
import { getMapperRegistry } from "@evolve-framework/contentful";
function getMapperRegistry(): MapperRegistry

Returns MapperRegistry

mapArticleOverviewPageAn overview entry.
import { mapArticleOverviewPage } from "@evolve-framework/contentful";
function mapArticleOverviewPage(
options: { context: ContextValue; content: OverviewEntry; nested?: boolean | undefined; },
): ArticleOverviewPage
OptionTypeDescription
contextContextValue
contentOverviewEntry
nested?boolean

Returns ArticleOverviewPage

mapArticlePageAn article entry.
import { mapArticlePage } from "@evolve-framework/contentful";
function mapArticlePage(
options: { context: ContextValue; content: ArticleEntry; nested?: boolean | undefined; },
): MappedArticlePage
OptionTypeDescription
contextContextValue
contentArticleEntry
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
OptionTypeDescription
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;
}
OptionTypeDescription
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[]
OptionTypeDescription
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
OptionTypeDescription
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[]
OptionTypeDescription
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
OptionTypeDescription
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
OptionTypeDescription
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[]
OptionTypeDescription
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 | undefined

Returns 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
OptionTypeDescription
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
OptionTypeDescription
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
OptionTypeDescription
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
OptionTypeDescription
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[]
OptionTypeDescription
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
OptionTypeDescription
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): AudienceType

Returns 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,
): ColumnsRatioType

Returns ColumnsRatioType

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">
OptionTypeDescription
categoryIdstring

The engine's category id. The join key the catalog subgraph resolves on.

nameRecord<string, string>

Category name per locale, e.g. { "en-GB": "Bikes" }.

pathstring | 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)
OptionTypeDescription
currencystring

The currency used in the store context.

localestring

The locale of the store context. For example: en-US.

storeKeystring

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): ContextValue

Returns 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.
ArticleListArticle cards: the articles the editor picked, or else the newest that match its filters on section, topic and category.
ArticleListResolvers
ArticleOverviewPageThe overview of one section of articles, such as a blog or the buying guides.
ArticleOverviewPageResolvers
ArticlePageAn article, such as a blog post, a buying guide or a news item: a page whose text owns it.
ArticlePageResolvers
ArticleResultOne page of articles, newest first.
ArticleResultResolvers
AudienceTypeWho a block is shown to.
AuthorWho wrote an article, as the byline and the author markup name them.
AuthorResolvers
BlockRich text is also a block of its own, placed directly in a page body.
BlockResolvers
BrandA brand.
BrandListBrand logos that link to their brand pages, in the order the editor placed them.
BrandListResolvers
BrandResolvers
BreadcrumbRepresents a single item in a breadcrumb trail.
BreadcrumbResolvers
BreadcrumbTypeRepresents different types of breadcrumbs in the navigation structure.
CampaignBannerA campaign: an image with the text beside it, not on it, and one call to action.
CampaignBannerResolvers
CatalogPageRepresents a product listing page with its surrounding content.
CatalogPageFacetFilterOne facet of a curated collection and the values it selects.
CatalogPageFacetFilterInputOne facet of a listing's filter and the values it selects.
CatalogPageFacetFilterResolvers
CatalogPageLayoutTypeHow a catalog page presents its category.
CatalogPageResolvers
CategoryListEntrances to categories: the ones the editor picked, or the children of one category.
CategoryListResolvers
ColumnEntryRepresents content types that can be used in columns.
ColumnEntryResolvers
ColumnsTwo to four blocks side by side, stacked in their order on a narrow screen.
ColumnsRatioTypeHow the width is shared between two columns, in the order they are placed.
ColumnsResolvers
ContentAssetRepresents a content asset, such as an image or file.
ContentAssetResolvers
ContentPageRepresents a content page with various sections and blocks.
ContentPageResolvers
ContentSearchHitA page or an article that matches a search.
ContentSearchHitResolvers
ContentSearchResultWhat the CMS answers to a search term.
ContentSearchResultResolvers
ContentSnippetRepresents a snippet of content that can be used in various places.
ContentSnippetResolvers
ContentTeaserAn image beside text, or text alone, with up to two links.
ContentTeaserResolvers
ContentVersionTypeSpecifies different versions of content.
CountryCodeScalarConfig
CurrencyScalarConfig
DateScalarConfig
DateTimeScalarConfig
DirectiveResolverFn
DirectiveResolvers
EmailAddressScalarConfig
ErrorShared interface for every error returned as data.
ErrorResolvers
Faq
FaqGroup
FaqGroupResolvers
FaqItem
FaqItemResolvers
FaqResolvers
FederationReferenceTypesMapping of federation reference types
FederationTypesMapping of federation types
FieldValidationIssueA single field-level validation failure, to attach to its input control
FieldValidationIssueResolvers
FigureOne key figure: a value with what it measures.
FigureListTwo to four key figures.
FigureListResolvers
FigureResolvers
FocalPointA point in an image, in percent from its left and top edges.
FocalPointResolvers
GraphQLRecursivePick
HotspotOne product pinned on a shoppable image.
HotspotResolvers
ImageOne image, or a pair side by side.
ImageResolvers
InputMaybe
IsTypeOfResolverFn
JsonScalarConfig
LinkA link with its own label, to one target: a page, a product, a storefront route or a URL.
LinkKindTypeWhat a resolved link points at: a page of the site, or a URL.
LinkResolvers
LinkVariantTypeHow prominently a link is drawn.
LocaleScalarConfig
Maybe
MenuItemOne menu entry: a link, or a heading for the entries below it.
MenuItemResolvers
MessagesThe store's fixed system copy, one entry per store, for the places no editor fills by hand.
MessagesResolvers
MutationDefines the available mutations in the schema.
MutationResolvers
MutationStoreContentPreviewArgsDefines the available mutations in the schema.
NavigationA menu: the header's, the footer's, or one of the project's own.
NavigationResolvers
NextResolverFn
Omit
OpenGraphOpen Graph protocol metadata for social media sharing
OpenGraphResolvers
PageA page a route can land on.
PageMetaPage metadata for SEO, from the page's three SEO fields.
PageMetaResolvers
PageRedirectWhere 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
PageSortOrderTypeSpecifies sorting options for pages.
PagesResultRepresents the result of a query for multiple pages.
PagesResultResolvers
PageTypeDefines the different types of pages available in the system.
PaginationWhere a page sits within the full result set.
PaginationResolvers
PaymentBrandTypeA way to pay the store accepts, which the site draws as that brand's logo.
ProductProduct entity containing all product information, variants, and metadata.
ProductCategoryRepresents a category of products.
ProductCategoryResolvers
ProductListProducts, either the variants the editor picked or those a source selects.
ProductListResolvers
ProductResolvers
ProductSortOrderTypeAvailable sorting options for product listings
ProductSourceWhich products a listing shows: those in a category, narrowed by facet selections, in a sort order.
ProductSourceFilterOne facet of a product source and the values it selects.
ProductSourceFilterResolvers
ProductSourceResolvers
ProductVariant
ProductVariantResolvers
PromoA card that links somewhere.
PromoListTwo to four promo cards side by side.
PromoListResolvers
PromoResolvers
QueryDefines the available queries in the schema.
QueryArticlesArgsDefines the available queries in the schema.
QueryCatalogPageArgsDefines the available queries in the schema.
QueryCatalogPageByFilterArgsDefines the available queries in the schema.
QueryContentPageArgsDefines the available queries in the schema.
QueryContentSearchArgsDefines the available queries in the schema.
QueryContentSnippetArgsDefines the available queries in the schema.
QueryMessagesArgsDefines the available queries in the schema.
QueryPageArgsDefines the available queries in the schema.
QueryPagesArgsDefines the available queries in the schema.
QueryRedirectArgsDefines the available queries in the schema.
QueryResolvers
QuerySiteArgsDefines the available queries in the schema.
QuerySiteSettingsArgsDefines the available queries in the schema.
ReferenceResolver
RequireFields
RequiresSessionDirectiveArgs
RequiresSessionDirectiveResolver
Resolver
ResolverFn
Resolvers
ResolversInterfaceTypesMapping of interface types
ResolversParentTypesMapping between all available schema types and the resolvers parents
ResolversTypesMapping between all available schema types and the resolvers types
ResolversUnionTypesMapping of union types
ResolverTypeWrapper
ResourceLinkRepresents a link to a resource, either internal or external.
ResourceLinkResolvers
ResourceLinkTypeSpecifies different types of resource links.
RichTextFormatted text, the same whichever CMS wrote it.
RichTextEmbedWhat rich text can embed.
RichTextEmbedResolvers
RichTextImageEmbedAn image placed in rich text.
RichTextImageEmbedResolvers
RichTextLinkA link in rich text, resolved by the adapter.
RichTextLinkResolvers
RichTextProductEmbedA product placed in rich text, by its sku.
RichTextProductEmbedResolvers
RichTextPromoEmbedA promo placed in rich text.
RichTextPromoEmbedResolvers
RichTextResolvers
RichTextShoppableImageEmbedA shoppable image placed in rich text.
RichTextShoppableImageEmbedResolvers
RichTextTipEmbedA tip placed in rich text.
RichTextTipEmbedResolvers
RichTextVideoEmbedA video placed in rich text.
RichTextVideoEmbedResolvers
ScalarsAll built-in and custom scalars, mapped to their actual values
SearchRedirectWhere a keyword rule sends a search instead of to a result page.
SearchRedirectResolvers
ShareableDirectiveArgs
ShareableDirectiveResolver
ShoppableImageOne image with two to six products pinned on it, also listed beside or below it.
ShoppableImageResolvers
SiteThe 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
SiteSettingsWhich page of the site answers each recurring purpose, such as the contact or the returns page, one entry per store.
SiteSettingsResolvers
SocialLinkThe store's profile on a social network; the site draws the network's icon.
SocialLinkResolvers
SocialPlatformTypeA social network a store keeps a profile on.
StepOne step of a step list.
StepListTwo to four numbered steps, such as how an account, a return or a job works.
StepListResolvers
StepResolvers
StoreContentPreviewDataRepresents data for storing content previews.
StoreContentPreviewDataResolvers
StoreContentPreviewError
StoreContentPreviewErrorResolvers
StoreContentPreviewResponse
StoreContentPreviewResponseResolvers
StoreContext
StoreContextResolvers
StorefrontRouteTypeA page the storefront itself serves rather than the CMS.
SubscriptionObject
SubscriptionResolveFn
SubscriptionResolver
SubscriptionResolverObject
SubscriptionSubscribeFn
SubscriptionSubscriberObject
TableOfContentsLinks to the anchors on the page.
TableOfContentsResolvers
TimeScalarConfig
TipA highlighted tip, in a page body or inside rich text.
TipResolvers
TopicWhat an article is about, such as tennis or maintenance.
TopicPageA topic's page below a section of articles.
TopicPageResolvers
TopicResolvers
TranslatedPathRepresents a translated path for a specific locale.
TranslatedPathResolvers
TrustRatingThe 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
UspRepresents a single Unique Selling Point (USP).
UspIconTypeThe icon a selling point shows, from a fixed set the storefront maps to its own glyphs.
UspListThe store's selling points, two to six of them.
UspListResolvers
UspResolvers
ValidationErrorThe input was malformed: one or more fields need editing before the operation can succeed.
ValidationErrorResolvers
VideoA YouTube video, played from the privacy-enhanced domain once the visitor consents.
VideoResolvers
YoutubeVideoA 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.
TypeArticleListFieldsFields of the articleList content type.
TypeArticleListSkeleton
TypeAuthorSkeleton
TypeBrandListFieldsFields of the brandList content type.
TypeBrandListSkeleton
TypeCampaignBannerFieldsFields of the campaign_banner content type.
TypeCampaignBannerSkeleton
TypeCategoryListFields
TypeCategoryListSkeleton
TypeColumnsFieldsFields of the columns content type.
TypeColumnsSkeleton
TypeContentSnippetEntry type definition for content type 'content_snippet' (Content Snippet)
TypeContentSnippetFieldsFields type definition for content type 'TypeContentSnippet'
TypeContentSnippetSkeletonEntry skeleton type definition for content type 'content_snippet' (Content Snippet)
TypeContentSnippetWithAllLocalesAndWithoutLinkResolutionResponse
TypeContentSnippetWithAllLocalesAndWithoutUnresolvableLinksResponse
TypeContentSnippetWithAllLocalesResponse
TypeContentSnippetWithoutLinkResolutionResponse
TypeContentSnippetWithoutUnresolvableLinksResponse
TypeContentTeaserFieldsFields of the content_teaser content type.
TypeContentTeaserSkeleton
TypeFaqFields
TypeFaqItemEntry type definition for content type 'faq_item' (FAQ Item)
TypeFaqItemFieldsFields type definition for content type 'TypeFaqItem'
TypeFaqItemSkeletonEntry skeleton type definition for content type 'faq_item' (FAQ Item)
TypeFaqItemWithAllLocalesAndWithoutLinkResolutionResponse
TypeFaqItemWithAllLocalesAndWithoutUnresolvableLinksResponse
TypeFaqItemWithAllLocalesResponse
TypeFaqItemWithoutLinkResolutionResponse
TypeFaqItemWithoutUnresolvableLinksResponse
TypeFaqSkeleton
TypeFigureFieldsFields of the figure content type.
TypeFigureListFieldsFields of the figure_list content type.
TypeFigureListSkeleton
TypeFigureSkeleton
TypeHotspotFieldsFields of the hotspot content type.
TypeHotspotSkeleton
TypeImageEntry type definition for content type 'image' (Image)
TypeImageFieldsFields type definition for content type 'TypeImage'
TypeImageSkeletonEntry skeleton type definition for content type 'image' (Image)
TypeImageWithAllLocalesAndWithoutLinkResolutionResponse
TypeImageWithAllLocalesAndWithoutUnresolvableLinksResponse
TypeImageWithAllLocalesResponse
TypeImageWithoutLinkResolutionResponse
TypeImageWithoutUnresolvableLinksResponse
TypeLinkFieldsFields of the link content type.
TypeLinkSkeleton
TypeMenuItemFieldsFields of the menu_item content type.
TypeMenuItemSkeleton
TypeMessagesFieldsFields of the messages content type.
TypeMessagesSkeleton
TypeNavigationFieldsFields of the navigation content type.
TypeNavigationSkeleton
TypePageArticleFieldsFields of the pageArticle content type.
TypePageArticleOverviewFieldsFields of the pageArticleOverview content type.
TypePageArticleOverviewSkeleton
TypePageArticleSkeleton
TypePageCatalogEntry type definition for content type 'catalog_page' (Product Catalog Page)
TypePageCatalogFieldsFields type definition for content type 'TypePageCatalog'
TypePageCatalogSkeletonEntry skeleton type definition for content type 'catalog_page' (Product Catalog Page)
TypePageCatalogWithAllLocalesAndWithoutLinkResolutionResponse
TypePageCatalogWithAllLocalesAndWithoutUnresolvableLinksResponse
TypePageCatalogWithAllLocalesResponse
TypePageCatalogWithoutLinkResolutionResponse
TypePageCatalogWithoutUnresolvableLinksResponse
TypePageContentEntry type definition for content type 'content_page' (Content Page)
TypePageContentFieldsFields type definition for content type 'TypePageContent'
TypePageContentSkeletonEntry skeleton type definition for content type 'content_page' (Content Page)
TypePageContentWithAllLocalesAndWithoutLinkResolutionResponse
TypePageContentWithAllLocalesAndWithoutUnresolvableLinksResponse
TypePageContentWithAllLocalesResponse
TypePageContentWithoutLinkResolutionResponse
TypePageContentWithoutUnresolvableLinksResponse
TypeProductListFieldsFields of the product_list content type.
TypeProductListSkeleton
TypePromoFieldsFields of the promo content type.
TypePromoListFieldsFields of the promo_list content type.
TypePromoListSkeleton
TypePromoSkeleton
TypeRichTextEntry type definition for content type 'rich_text' (Rich Text)
TypeRichTextFieldsFields type definition for content type 'TypeRichText'
TypeRichTextSkeletonEntry skeleton type definition for content type 'rich_text' (Rich Text)
TypeRichTextWithAllLocalesAndWithoutLinkResolutionResponse
TypeRichTextWithAllLocalesAndWithoutUnresolvableLinksResponse
TypeRichTextWithAllLocalesResponse
TypeRichTextWithoutLinkResolutionResponse
TypeRichTextWithoutUnresolvableLinksResponse
TypeShoppableImageFieldsFields of the shoppable_image content type.
TypeShoppableImageSkeleton
TypeSiteFieldsFields of the site content type.
TypeSiteSkeleton
TypeSocialLinkSkeleton
TypeStepFieldsFields of the step content type.
TypeStepListFieldsFields of the step_list content type.
TypeStepListSkeleton
TypeStepSkeleton
TypeTableOfContentsFieldsFields of the tableOfContents content type.
TypeTableOfContentsSkeleton
TypeTipFieldsFields of the tip content type.
TypeTipSkeleton
TypeTopicSkeleton
TypeUspFieldsFields of the usp content type.
TypeUspListFieldsFields 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.