willwill96-petfinder-graphql
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i willwill96-petfinder-graphql

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

49.7 kB

Total Files

20

Last publish

Collaborators

  • willwill96