reject
Rejects requests by a specified URL pattern, method, or type and operator. You may supply a single pattern, or a list (array) of them. This mutation, by default, will reject any requests that match any pattern, which we call an "or" operator. To reject requests where conditions must all match, specify an "and" operator in the mutation. Note that this only has an effect when the query is executing, so scripts that return quickly will likely see assets loading in the editor as these rejections only happen when mutations are executing.
Rejecting images or media
mutation RejectImages {
reject(type: [image, media]) {
enabled
time
}
goto(url: "https://cnn.com"
waitUntil: firstContentfulPaint) {
status
time
}
}
Rejecting media when coming from google.com domain
mutation Reject {
reject(
operator: and
type: image
url: "*google.com*"
) {
enabled
time
}
goto(url: "https://cnn.com"
waitUntil: firstContentfulPaint) {
status
time
}
}
reject(
enabled: Boolean = true
method: [Method]
operator: OperatorTypes = or
type: [ResourceType]
url: [String]
): RejectResponse
Arguments
reject.enabled
● Boolean
scalar
Whether or not to enable request rejections
reject.method
● [Method]
list enum
The Method of the request you'd like to reject
reject.operator
● OperatorTypes
enum
Whether to "or" conditions together, meaning any condition that matches will be rejected, or "and" them together meaning every condition must match to reject the request.
reject.type
● [ResourceType]
list enum
The type of resource you'd like to reject request to
reject.url
● [String]
list scalar
The glob-style URL pattern you'd like to reject requests to
Type
RejectResponse
object
The response parameters for the reject mutation