public function theResponseIsGraphQLErrorWith(string $message)
    {
        $this->assertResponseStatus(Response::HTTP_OK);

        //success GraphQL response should not contains errors
        if ($this->client->getGraphQL()) {
            if ($this->isValidGraphQLResponse() && $errors = $this->getGraphQLResponseError()) {
                $errorsStack = '';
                foreach ($errors as $error) {
                    $errorsStack .= $error->message."\n";
                }

                Assert::assertContains($message, $errorsStack);
            } else {
                $this->graphQLContext->debugLastQuery();
                throw new AssertionFailedError('The response is not the expected error response.');
            }
        }
    }
public function theResponseIsGraphQLErrorWith(string $message)
    {
        $this->assertResponseStatus(Response::HTTP_OK);

        //success GraphQL response should not contains errors
        if ($this->client->getGraphQL()) {
            if ($this->isValidGraphQLResponse() && $errors = $this->getGraphQLResponseError()) {
                $errorsStack = '';
                foreach ($errors as $error) {
                    $errorsStack .= $error->message."\n";
                }

                Assert::assertContains($message, $errorsStack);
            } else {
                $this->graphQLContext->debugLastQuery();
                throw new AssertionFailedError('The response is not the expected error response.');
            }
        }
    }
public function theResponseIsGraphQLErrorWith ( string $ message ) { $ this -> assertResponseStatus ( Response :: HTTP_OK ) ; //success GraphQL response should not contains errors if ( $ this -> client -> getGraphQL ( ) ) { if ( $ this -> isValidGraphQLResponse ( ) && $ errors = $ this -> getGraphQLResponseError ( ) ) { $ errorsStack = '' ; foreach ( $ errors as $ error ) { $ errorsStack .= $ error -> message . "\n" ; } Assert :: assertContains ( $ message , $ errorsStack ) ; } else { $ this -> graphQLContext -> debugLastQuery ( ) ; throw new AssertionFailedError ( 'The response is not the expected error response.' ) ; } } }
Assert that latest response is a GraphQL error with the given message

@Then /^the response is GraphQL error with "([^"]*)"$/
Assert that latest response is a GraphQL error with the given message