GraphQL Playground is a simple GraphQL server implementation with a built-in playground for testing queries and mutations.
- GraphQL Server: Provides a GraphQL server with a set of predefined schemas, resolvers, and middleware.
- Rate Limiting: Implements a rate limiter using the
rate-limiter-flexible
library to control request rates. - Graceful Shutdown: Handles graceful shutdown on receiving the SIGINT signal for a clean server shutdown.
- Apollo Server: Utilizes Apollo Server for serving GraphQL requests with enhanced features.
-
Clone the repository:
git clone https://github.com/Karl-Horning/graphql-playground.git
-
Install dependencies:
cd graphql-playground npm install
-
Set up your environment variables:
Create a
.env
file in the project root and define the required variables:PORT=4000 # Add other environment variables as needed
-
Start the GraphQL Playground:
npm start
Visit http://localhost:4000/graphql
in your browser to access the GraphQL Playground. You can use the interactive playground to explore and test GraphQL queries and mutations.
The following environment variables can be configured in the .env
file:
- PORT: The port on which the server will run. Default is 4000.
- GraphQL Playground:
http://localhost:4000/graphql
To run tests, use the following command:
npm test
Contributions are welcome! Feel free to open issues, submit pull requests, or provide feedback.
This project is licensed under the MIT License.