graphql_test
Simple Golang based GraphQL endpoint test using graphql-go, graphiql, and a MySQL database
Quick start
Install the database script in your MySQL database:
mysql -u USERNAME starwars < starwars.sql
Set the following environment variables for database connectivity:
To test, navigate to http://localhost:8080
in your browser to see the excellent GraphiQL interface and submit queries that way. (Sidenote: Need to customize where the GraphiQL interface points to? Just adjust the fetcher).
To test in code, POST to http://localhost:8080/graphql
with Content-Type: application/graphql
and the GraphQL query:
query Root{ latestPost }
If the test is successful, you should get the following response back:
{
"data": {
"latestPost": "Hello World!"
}
}