Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Latest commit

 

History

History
51 lines (32 loc) · 1.79 KB

README.md

File metadata and controls

51 lines (32 loc) · 1.79 KB

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