0.2.0 • Published 6 years ago

@parse-graphql/express v0.2.0

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

Parse GraphQL HTTP npm (scoped)

WIP

Connect style middleware that uses parse-graphql-schema to automatically create a GraphQL API from an instance of parse-server.

Install

yarn add @parse-graphql/express

Usage

This wraps express-graphql and can be used with frameworks such as Express, Restify, and Connect.

Here's an example using express, see more in the examples repo.

const express = require('express');
const parseGraphQL = require('@parse-graphql/express');

const app = express();

const graphqlAPI = parseGraphQL({
  appId: 'foo',
  masterKey: 'bar',
  serverURL: 'http://foobar.com/parse',
  dynamicSchema: true,
  graphiql: true,
});

app.use('/graphql', graphqlAPI);

app.listen(4001);

Options

appId: string - required

serverURL: string - required

javascriptKey: string - optional, use if you added one to your parse server

masterKey: string - optional if parseSchema is used

parseSchema: Object - optional, can pass in Parse Server schema (results property from GET <serverURL>/schema) rather than have it be fetched

dynamicSchema: boolean - whether or not to refetch/recreate schema on every request

graphiql: boolean - whether or not to run GraphiQL