Highly extensible GraphQL API for the WordPress blog platform
746
Highly extensible GraphQL read APIs for the WordPress blog platform.
By reading directly from the MySQL database, this library allows you to make the WordPress webserver externally inaccessible and expose the content to your UI via GraphQL. This integration model makes it the perfect partner for a Progressive Web App built using a technology such as ReactJS.
Just use docker run to get started.
The following environmental variables are available to configure access to the database:
| Environment Variable | Default Value | Notes |
|---|---|---|
| MYSQL_HOSTNAME | localhost | MySQL database hostname |
| MYSQL_USERNAME | root | MySQL user with read permissions to the WordPress database |
| MYSQL_PASSWORD | [empty] | Password for the MySQL user |
| MYSQL_DATABASE | wordpress | WordPress database name |
| MYSQL_TABLE_PREFIX | wp_ | Prefix for the table names within the WordPress database |
The application is a wrapper around a set of GraphQL schemas and types, along with resolvers which retrieve data directly from the WordPress database.
If you are using the server directly then by default it exposes an HTTP server on port 3000. This can be changed with the options key server.port passed into the application constructor and defined in the config file.
The data are then made available as a GraphQL API at:
http://localhost:3000/graphql
There is also a GraphiQL UI for navigating the GraphQL API available at:
http://localhost:3000/graphiql
The API is intended to be discoverable, and can be easily browsed using the GraphiQL endpoint.
Content type
Image
Digest
Size
37.8 MB
Last updated
almost 9 years ago
docker pull abstractvector/contentry