fulfill
Fulfills matching requests with a canned response instead of letting them hit
the network, mirroring the request-interceptor mocking used by the REST APIs.
Matching follows the same glob-style URL/method/type conditions as reject.
**Usage Example:**
mutation MockApi {
fulfill(
url: ["*/api/user"]
status: 200
contentType: "application/json"
body: "{\\"name\\":\\"test\\"}"
) {
time
}
goto(url: "https://example.com") {
status
}
}
**Field Definition:**
fulfill(
url: [String]
method: [Method]
type: [ResourceType]
operator: OperatorTypes = or
status: Int = 200
contentType: String
body: String
headers: [HeaderInput]
): FulfillResponse
Arguments
fulfill.url ● [String] list scalar
The glob-style URL pattern(s) to fulfill requests for
fulfill.method ● [Method] list enum
The HTTP Method(s) of the requests to fulfill
fulfill.type ● [ResourceType] list enum
The resource type(s) of the requests to fulfill
fulfill.operator ● OperatorTypes enum
Whether to "or" the conditions together (any match fulfills) or "and" them (all must match)
fulfill.status ● Int scalar
The HTTP status code to respond with. Defaults to 200
fulfill.contentType ● String scalar
The Content-Type header to respond with
fulfill.body ● String scalar
The response body to respond with
fulfill.headers ● [HeaderInput] list input
Additional response headers to respond with
Type
FulfillResponse object
Response returned after registering a request-fulfillment interceptor