@parse-graphql/express

0.2.0 • Public • Published

Parse GraphQL HTTP npm (scoped) Parse GraphQL Logo

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

Readme

Keywords

none

Package Sidebar

Install

npm i @parse-graphql/express

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

7.52 kB

Total Files

7

Last publish

Collaborators

  • stephentuso