- 1. Introduction
- 2. Dependencies
- 3. Configuration
- 4. Structured logging
- 5. Trace SQL
- 6. Reload Schema
- 7. Deployment
QP GraphQL Server is a web application on dotnet core 5.0. It serves to perform GraphQL queries over QP database. GraphQL Specification is also available.
The application depens on NuGet packages:
Configuration is available on appsettings.json
file.
Postgres settings
"ConnectionStrings": {
"QPConnectionString": "Server=dbserver;Database=dbname;User Id=user;Password=password",
"Type": "Postgres"
},
SqlServer settings
"ConnectionStrings": {
"QPConnectionString": "Initial Catalog=dbname;Data Source=dbserver;User ID=user;Password=password",
"Type": "SqlServer"
},
Configuration is available on appsettings.json
file.
"SchemaAutoReload": true,
"SchemaReloadInterval": "00:02:00",
Reload API
POST /api/schema/reload
reload schemaGET /api/schema/context
get current schema context
One can reload the schema directly in the browser console:
await (await fetch('/api/schema/reload', { method: 'POST' })).json();
One can build and run docker containers manually. It's the easiest way to run the application. Here basic commands for docker.
Build image
docker build -t qp.graphql -f QP.GraphQL.App/Dockerfile .
Run the application in docker container on port 8889
docker run -it -p 8889:80 -e ConnectionStrings__QPConnectionString="{db connection}" -e ConnectionStrings__Type="{db type}" --rm --name=qp.graphql qp.graphql
where
{db connection}
is the database connection{db type}
is the database type whetherSqlServer
orPostgres
Stop container if running
docker stop qp.graphql
Application is available on Localhost
docker run -it -p 8890:80 -e ConnectionStrings__QPConnectionString="{db connection}" -e ConnectionStrings__Type="{db type}" --rm --name=qp-graphql-service qpcms/qp-graphql-service:{tag}
where
{tag}
is application version{db connection}
is the database connection{db type}
is the database type whetherSqlServer
orPostgres
Application is available on Localhost