Skip to content

Commit

Permalink
docs(scope): fix REST and GQL examples. Refs: #677
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashornych committed Dec 3, 2024
1 parent 2c6d60c commit 077523b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ mutation {
# products are not organized in the tree
{
setEntitySchemaWithHierarchyMutation: {
withHierarchy: false
withHierarchy: false,
indexedInScopes: [LIVE]
}
},
# prices are referencing another entity stored in Evita
{
setEntitySchemaWithPriceMutation: {
withPrice: true
indexedInScopes: [LIVE]
indexedPricePlaces: 2
}
},
Expand All @@ -71,67 +73,73 @@ mutation {
createAttributeSchemaMutation: {
name: "code",
type: String
uniquenessType: UNIQUE_WITHIN_COLLECTION
uniqueInScopes: [{
scope: LIVE,
uniquenessType: UNIQUE_WITHIN_COLLECTION
}]
}
},
{
createAttributeSchemaMutation: {
name: "url"
type: String
uniquenessType: UNIQUE_WITHIN_COLLECTION
uniqueInScopes: [{
scope: LIVE,
uniquenessType: UNIQUE_WITHIN_COLLECTION
}]
localized: true
}
},
{
createAttributeSchemaMutation: {
name: "oldEntityUrls"
type: StringArray
filterable: true
filterableInScopes: [LIVE]
localized: true
}
},
{
createAttributeSchemaMutation: {
name: "name"
type: String
filterable: true
sortable: true
filterableInScopes: [LIVE]
sortableInScopes: [LIVE]
}
},
{
createAttributeSchemaMutation: {
name: "ean"
type: String
filterable: true
filterableInScopes: [LIVE]
}
},
{
createAttributeSchemaMutation: {
name: "priority"
type: Long
sortable: true
sortableInScopes: [LIVE]
}
},
{
createAttributeSchemaMutation: {
name: "validity"
type: DateTimeRange
filterable: true
filterableInScopes: [LIVE]
}
},
{
createAttributeSchemaMutation: {
name: "quantity"
type: BigDecimal
filterable: true
filterableInScopes: [LIVE]
indexedDecimalPlaces: 2
}
},
{
createAttributeSchemaMutation: {
name: "alias"
type: Boolean
filterable: true
filterableInScopes: [LIVE]
}
},
# here we define set of associated data, that can be stored along with entity
Expand All @@ -155,7 +163,7 @@ mutation {
referencedEntityType: "Category"
referencedEntityTypeManaged: true
cardinality: ZERO_OR_MORE
indexed: true
indexedInScopes: [LIVE]
}
},
{
Expand All @@ -165,7 +173,7 @@ mutation {
createAttributeSchemaMutation: {
name: "categoryPriority"
type: Long
sortable: true
sortableInScopes: [LIVE]
}
}
}
Expand All @@ -177,8 +185,8 @@ mutation {
referencedEntityType: "Brand"
referencedEntityTypeManaged: true
cardinality: ZERO_OR_ONE
indexed: true
faceted: true
indexedInScopes: [LIVE]
facetedInScopes: [LIVE]
}
},
# references may be also represented be entities unknown to Evita
Expand All @@ -188,8 +196,8 @@ mutation {
referencedEntityType: "Stock"
referencedEntityTypeManaged: true
cardinality: ZERO_OR_MORE
indexed: true
faceted: true
indexedInScopes: [LIVE]
facetedInScopes: [LIVE]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ PUT /rest/evita/schema
// products are not organized in the tree
{
"setEntitySchemaWithHierarchyMutation": {
"withHierarchy": false
"withHierarchy": false,
"indexedInScopes": ["LIVE"]
}
},
// prices are referencing another entity stored in Evita
{
"setEntitySchemaWithPriceMutation": {
"withPrice": true,
"indexedInScopes": ["LIVE"],
"indexedPricePlaces": 2
}
},
Expand All @@ -72,67 +74,73 @@ PUT /rest/evita/schema
"createAttributeSchemaMutation": {
"name": "code",
"type": "String",
"uniquenessType": "UNIQUE_WITHIN_COLLECTION"
"uniqueInScopes": [{
"scope": "LIVE",
"uniquenessType": "UNIQUE_WITHIN_COLLECTION"
}]
}
},
{
"createAttributeSchemaMutation": {
"name": "url",
"type": "String",
"uniquenessType": "UNIQUE_WITHIN_COLLECTION",
"uniqueInScopes": [{
"scope": "LIVE",
"uniquenessType": "UNIQUE_WITHIN_COLLECTION"
}],
"localized": true
}
},
{
"createAttributeSchemaMutation": {
"name": "oldEntityUrls",
"type": "StringArray",
"filterable": true,
"filterableInScopes": ["LIVE"],
"localized": true
}
},
{
"createAttributeSchemaMutation": {
"name": "name",
"type": "String",
"filterable": true,
"sortable": true
"filterableInScopes": ["LIVE"],
"sortableInScopes": ["LIVE"]
}
},
{
"createAttributeSchemaMutation": {
"name": "ean",
"type": "String",
"filterable": true
"filterableInScopes": ["LIVE"]
}
},
{
"createAttributeSchemaMutation": {
"name": "priority",
"type": "Long",
"sortable": true
"sortableInScopes": ["LIVE"]
}
},
{
"createAttributeSchemaMutation": {
"name": "validity",
"type": "DateTimeRange",
"filterable": true
"filterableInScopes": ["LIVE"]
}
},
{
"createAttributeSchemaMutation": {
"name": "quantity",
"type": "BigDecimal",
"filterable": true,
"filterableInScopes": ["LIVE"],
"indexedDecimalPlaces": 2
}
},
{
"createAttributeSchemaMutation": {
"name": "alias",
"type": "Boolean",
"filterable": true
"filterableInScopes": ["LIVE"]
}
},
// here we define set of associated data, that can be stored along with entity
Expand All @@ -156,7 +164,7 @@ PUT /rest/evita/schema
"referencedEntityType": "Category",
"referencedEntityTypeManaged": true,
"cardinality": "ZERO_OR_MORE",
"indexed": true
"indexedInScopes": ["LIVE"]
}
},
{
Expand All @@ -166,7 +174,7 @@ PUT /rest/evita/schema
"createAttributeSchemaMutation": {
"name": "categoryPriority",
"type": "Long",
"sortable": true
"sortableInScopes": ["LIVE"]
}
}
}
Expand All @@ -178,8 +186,8 @@ PUT /rest/evita/schema
"referencedEntityType": "Brand",
"referencedEntityTypeManaged": true,
"cardinality": "ZERO_OR_ONE",
"indexed": true,
"faceted": true
"indexedInScopes": ["LIVE"],
"facetedInScopes": ["LIVE"]
}
},
// references may be also represented be entities unknown to Evita
Expand All @@ -189,8 +197,8 @@ PUT /rest/evita/schema
"referencedEntityType": "Stock",
"referencedEntityTypeManaged": true,
"cardinality": "ZERO_OR_MORE",
"indexed": true,
"faceted": true
"indexedInScopes": ["LIVE"],
"facetedInScopes": ["LIVE"]
}
}
]
Expand Down

0 comments on commit 077523b

Please sign in to comment.