MenuQueries LibraryReplace "http" with "https" in all image sources in a postReplace "http" with "https" in all image sources in a postThis query replaces all http URLs with https in the image sources from the post's HTML. query GetPostData($postId: ID!) { post(by: { id: $postId }, status: any) { id rawContent adaptedRawContent: _strRegexReplace( searchRegex: "/<img(\\s+)?([^>]*?\\s+?)?src=([\"'])http:\\/\\/(.*?)/" replaceWith: "<img$1$2src=$3https://$4$3" in: $__rawContent ) @export(as: "adaptedRawContent") } } mutation ReplaceHttpWithHttpsInImageSources($postId: ID!) @depends(on: "GetPostData") { updatePost(input: { id: $postId, contentAs: { html: $adaptedRawContent }, }) { status errors { __typename ...on ErrorPayload { message } } post { id title rawContent } } }CopyPrevRemove a block from postsNextReplace an old post slug with a new post slug in all posts
This query replaces all http URLs with https in the image sources from the post's HTML. query GetPostData($postId: ID!) { post(by: { id: $postId }, status: any) { id rawContent adaptedRawContent: _strRegexReplace( searchRegex: "/<img(\\s+)?([^>]*?\\s+?)?src=([\"'])http:\\/\\/(.*?)/" replaceWith: "<img$1$2src=$3https://$4$3" in: $__rawContent ) @export(as: "adaptedRawContent") } } mutation ReplaceHttpWithHttpsInImageSources($postId: ID!) @depends(on: "GetPostData") { updatePost(input: { id: $postId, contentAs: { html: $adaptedRawContent }, }) { status errors { __typename ...on ErrorPayload { message } } post { id title rawContent } } }Copy