Skip to content

Latest commit

 

History

History

petfinder-graphql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Docker Pulls

Petfinder GraphQL Server

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

Configuration

Petfinder API Key (Required)

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}

Optional Configuration

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

Example Usage

Docker (From Docker Hub)

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

Docker Compose (From Docker Hub)

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
...