Skip to content

Latest commit

 

History

History

willwill96-petfinder-graphql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

willwill96-petfinder-graphql

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

Example Usage

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