1.0.4 • Published 6 years ago

petfinder-graphql v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

npm version

This package provides a GraphQL schema for the Petfinder.com API. You will need to register an account to get an API key Here

Installation

$ npm install petfinder-graphql

Usage

const schema = require('petfinder-graphql')('API_KEY_HERE');

//Sample using apollo-server-express
const express = require('express');

// This package automatically parses JSON requests.
const bodyParser = require('body-parser');

// This package will handle GraphQL server requests and responses
// for you, based on your schema.
const {graphqlExpress, graphiqlExpress} = require('apollo-server-express');

var app = express();
app.use('/graphql', bodyParser.json(), graphqlExpress({schema}));

app.use('/graphiql', graphiqlExpress({
  endpointURL: '/graphql'
}));

const PORT = 3000;
app.listen(PORT, () => {
  console.log(`GraphQL server running on port ${PORT}.`)
});

Testing

$ npm test
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago