In this post I'm going to set up the environment to test the queries and mutations, and test the
langs query. It's the same query created in the previous post Basic example Laravel + GraphQL.
In order to test a query o mutation I'll create three functions in the file TestCase.php.
To verify graphql public endpoint.
To verify graphql private endpoint, it need a user logged.
If a test fail, it's easy debug in this way.
This is quere that I used as example in the post Basic example Laravel + GraphQL
And now, just run
php artisan test to test it.
If the query to test need authenticacion, you have to add the trail
use WithoutMiddleware; from
use Illuminate\Foundation\Testing\WithoutMiddleware;. You may see the code here. If you would like to see it live please go here.