WIP
Connect style middleware that uses parse-graphql-schema to automatically create a GraphQL API from an instance of parse-server.
yarn add @parse-graphql/express
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);
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