v1Redirects
Query redirects with filtering and pagination
v1Redirectsquery
Arguments
localeStringWhen set, only redirects for this locale are returned
itemIds[String!]When set, only redirects linked to these item UUIDs are returned
oldSlugStringWhen set, only redirects with this source path or slug are returned
newSlugStringWhen set, only redirects with this target path or slug are returned
redirectTypeRedirectTypeWhen set, only redirects of this type (PRODUCT or PAGE) are returned
pageIntPage number (1-based, default 1)
perPageIntPage size (default 100, max 1000)
Returns
Redirect with pagination information
Query Reference
query V1Redirects($locale: String, $itemIds: [String!], $oldSlug: String, $newSlug: String, $redirectType: RedirectType, $page: Int, $perPage: Int) { v1Redirects(locale: $locale, itemIds: $itemIds, oldSlug: $oldSlug, newSlug: $newSlug, redirectType: $redirectType, page: $page, perPage: $perPage) { redirects { id itemId oldSlug newSlug redirectType createdAt locale } pageInfo { totalPages currentPage hasNextPage hasPreviousPage } }}enum RedirectType {
PRODUCT
PAGE
COLLECTION
CATEGORY
PRODUCT_BUNDLE
BRAND
SERIE
CAMPAIGN
}{
"locale": "string",
"itemIds": [
"string"
],
"oldSlug": "string",
"newSlug": "string",
"redirectType": "PRODUCT",
"page": 0,
"perPage": 0
}type RedirectsConnection {
redirects: [Redirect!]!
pageInfo: PageInfo!
}
type Redirect {
id: String!
itemId: String
oldSlug: String!
newSlug: String!
redirectType: RedirectType!
createdAt: DateTime
locale: String
}
type PageInfo {
totalPages: Int!
currentPage: Int!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
}Try it
Server
Bodyapplication/json
Request
curl -X POST 'https://graphql.enad.io/{app_id}/graphql' \
-H 'Content-Type: application/json' \
-d '{
"query": "query V1Redirects($locale: String, $itemIds: [String!], $oldSlug: String, $newSlug: String, $redirectType: RedirectType, $page: Int, $perPage: Int) {\n v1Redirects(locale: $locale, itemIds: $itemIds, oldSlug: $oldSlug, newSlug: $newSlug, redirectType: $redirectType, page: $page, perPage: $perPage) {\n redirects {\n id\n itemId\n oldSlug\n newSlug\n redirectType\n createdAt\n locale\n }\n pageInfo {\n totalPages\n currentPage\n hasNextPage\n hasPreviousPage\n }\n }\n}",
"variables": {
"locale": "string",
"itemIds": [
"string"
],
"oldSlug": "string",
"newSlug": "string",
"redirectType": "PRODUCT",
"page": 0,
"perPage": 0
}
}'const response = await fetch("https://graphql.enad.io/{app_id}/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: "{\n \"query\": \"query V1Redirects($locale: String, $itemIds: [String!], $oldSlug: String, $newSlug: String, $redirectType: RedirectType, $page: Int, $perPage: Int) {\\n v1Redirects(locale: $locale, itemIds: $itemIds, oldSlug: $oldSlug, newSlug: $newSlug, redirectType: $redirectType, page: $page, perPage: $perPage) {\\n redirects {\\n id\\n itemId\\n oldSlug\\n newSlug\\n redirectType\\n createdAt\\n locale\\n }\\n pageInfo {\\n totalPages\\n currentPage\\n hasNextPage\\n hasPreviousPage\\n }\\n }\\n}\",\n \"variables\": {\n \"locale\": \"string\",\n \"itemIds\": [\n \"string\"\n ],\n \"oldSlug\": \"string\",\n \"newSlug\": \"string\",\n \"redirectType\": \"PRODUCT\",\n \"page\": 0,\n \"perPage\": 0\n }\n}"
});import requests
response = requests.post(
"https://graphql.enad.io/{app_id}/graphql",
headers={
"Content-Type": "application/json"
},
data="{\n \"query\": \"query V1Redirects($locale: String, $itemIds: [String!], $oldSlug: String, $newSlug: String, $redirectType: RedirectType, $page: Int, $perPage: Int) {\\n v1Redirects(locale: $locale, itemIds: $itemIds, oldSlug: $oldSlug, newSlug: $newSlug, redirectType: $redirectType, page: $page, perPage: $perPage) {\\n redirects {\\n id\\n itemId\\n oldSlug\\n newSlug\\n redirectType\\n createdAt\\n locale\\n }\\n pageInfo {\\n totalPages\\n currentPage\\n hasNextPage\\n hasPreviousPage\\n }\\n }\\n}\",\n \"variables\": {\n \"locale\": \"string\",\n \"itemIds\": [\n \"string\"\n ],\n \"oldSlug\": \"string\",\n \"newSlug\": \"string\",\n \"redirectType\": \"PRODUCT\",\n \"page\": 0,\n \"perPage\": 0\n }\n}",
)Response
{
"data": {
"v1Redirects": {
"redirects": [
{
"id": "string",
"itemId": "string",
"oldSlug": "string",
"newSlug": "string",
"redirectType": "PRODUCT",
"createdAt": null,
"locale": "string"
}
],
"pageInfo": {
"totalPages": 0,
"currentPage": 0,
"hasNextPage": true,
"hasPreviousPage": true
}
}
}
}