Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Data Model
vtex.search-graphql
Version: 0.72.0
Latest version: 0.72.0

vtex.search-graphql owns no runtime data — it owns the GraphQL schema contract for the search domain. The authoritative model is the schema itself:

Type modules

FileOwns
Product.graphqlProduct, Item (SKU), ProductUniqueIdentifier, related types
ProductSearch.graphqlProductSearchResult, search-result wrapping
Facets.graphqlFacets, SelectedFacetInput, facet dimensions
Banners.graphqlBanners, banner items
Autocomplete.graphqlAutocomplete responses
SearchSuggestions.graphqlSearch-term suggestions
Suggestions.graphqlRelated-search suggestions
Correction.graphqlQuery correction
Brand.graphqlBrand entity
Category.graphqlCategory entity
Benefits.graphqlPromotion / discount-list metadata
ItemMetadata.graphqlCart-style metadata for Item
Advertisement.graphqlSponsored / ad fields on products
PageType.graphqlURL slug → entity-type resolver
SearchURLStats.graphqlAnalytics queries (top searches, etc.)

Resolution sites

Each Query field in schema.graphql is resolved at runtime by vtex.search-resolver. The mapping is:

Schema queryResolver module (in search-resolver)
product, productSearch, facets, banners, correction, searchSuggestions, autocompleteSearchSuggestionsnode/resolvers/search/
topSearches and relatednode/resolvers/stats/
benefit / promotion fields on Product / Offernode/resolvers/benefits/

Directive contracts


_10
# graphql/directives.graphql (effective contract)
_10
enum CacheControlScope { PUBLIC, SEGMENT }
_10
enum MaxAge { SHORT, MEDIUM, LONG }
_10
_10
directive @cacheControl(scope: CacheControlScope, maxAge: MaxAge) on FIELD_DEFINITION
_10
directive @withSegment on FIELD_DEFINITION

  • @cacheControl(scope: SEGMENT, ...) is the default for queries that vary per shopper (most of them).
  • Removing @withSegment from a field changes its caching semantics — agents should not do this without coordinating with the resolver team.

Source: node/package.json

The node/package.json in this repo ({ "name": "search-graphql", "description": "Don't delete this file, it's necessary to generate the TypeScript types of the GraphQL" }) is a placeholder used by the VTEX IO graphql builder to generate TypeScript typings consumed by vtex.search-resolver. Do not extend it with scripts or dependencies — it is not the runtime.

See also
Vtex.search Graphql
VTEX IO Apps
VTEX App Store
VTEX IO Apps
Was this helpful?