An npm package with utilities for scaffoloding a graphql server wrapping the Petfinder API
NOTE: By using the Petfinder API, you must comply with the Petfinder API Terms of Service
import { ApolloServer } from 'apollo-server-micro'
import {
petFinderGraphQlSchema,
generatePetfinderGraphQlContext,
} from 'willwill96-petfinder-graphql'
const petfinderApiKey = 'yourKey'
const petfinderSecreteKey = 'yourSecretKey'
const { typeDefs, resolvers } = petFinderGraphQlSchema
const server = new ApolloServer({
typeDefs,
resolvers,
context: generatePetfinderGraphQlContext({
petfinderApiKey,
petfinderSecretKey,
}),
})
For a full example, see the express implementation hosted as a docker image or Nextjs API route implementation