This is the code for a GraphQL Server which wraps the Petfinder API routes.
The GraphQL schema was generated using the openapi-to-graphql tool along with the Petfinder OpenAPI Specification
To run this project, you'll need to get a Petfinder API Key and Secret so that you can authenticate with Petfinder. Petfinder Docs
NOTE: By using this software, you must comply with the Petfinder API Terms of Service
Set your environment variables as follows:
PETFINDER_API_KEY={yourPetfinderAPIKey}
PETFINDER_SECRET_KEY=${yourPetfinderSecretKey}
The following environment variables can be set to adjust the configuration:
- PLAYGROUND_ENABLED (default:
false
): If truthy, the server hosts GraphQL Playground from its URL. - PETFINDER_GRAPHQL_PORT (default:
4000
): Sets the port the server will be hosted on - PETFINDER_GRAPHQL_PATH (default:
/graphql
): Sets the path the server will be hosted on
docker pull wbw4sv/petfinder-graphql:latest
docker run -e PETFINDER_API_KEY={yourPetfinderAPIKey} -e PETFINDER_SECRET_KEY=${yourPetfinderSecretKey} -p -d 4000:4000 wbw4sv/petfinder-graphql
Example docker-compose.yml
version: "3"
services:
petfinder-graphql:
image: wbw4sv/petfinder-graphql
container_name: petfinder-graphql
ports:
- 4000:4000
restart: always
environment:
- PETFINDER_API_KEY=${PETFINDER_API_KEY}
- PETFINDER_SECRET_KEY=${PETFINDER_SECRET_KEY}
- PLAYGROUND_ENABLED=true
...