Queries LibraryReplace the old domain with a new domain in all posts
Replace the old domain with a new domain in all posts
This query first filters all posts containing "https://my-old-domain.com"
in its content, and replaces this string with "https://my-new-domain.com"
.
This query requires the endpoint to have Nested Mutations enabled.
mutation ReplaceOldWithNewDomainInPosts(
$oldDomain: String!,
$newDomain: String!
) {
posts(
filter: {
search: $oldDomain
},
pagination: {
limit: -1
}
) {
id
rawContent
adaptedRawContent: _strReplace(
search: $oldDomain
replaceWith: $newDomain
in: $__rawContent
)
update(input: {
contentAs: { html: $__adaptedRawContent }
}) {
status
errors {
__typename
...on ErrorPayload {
message
}
}
post {
id
rawContent
}
}
}
}