Skip to main content

execute_script

Function execute_script 

Source
pub async fn execute_script<F, Fut>(
    execute_request: F,
    script: Script,
) -> Vec<Response>
where F: FnMut(Request) -> Fut, Fut: Future<Output = Response>,
Expand description

Execute a sequence of GraphQL requests, calling the provided handler on each request.

The handler can be as simple as |req| schema.execute(req), but you can also put additional logic there.

Queries and mutations starting with _ are not returned in the final list of responses. This is useful for ommiting the feedback from the initial “populate the DB” boilerplate in the response snapshot.