GraphQL support via cli (#5697)
* Including GraphQL options in CLI - now it was auto-generated * Improving the way that the headers are passed to the playground * Including README notes about GraphQL * Improving final text
This commit is contained in:
committed by
GitHub
parent
7ffb3b65e0
commit
5bc79cc3db
@@ -34,9 +34,10 @@ import { UsersRouter } from './Routers/UsersRouter';
|
||||
import { PurgeRouter } from './Routers/PurgeRouter';
|
||||
import { AudiencesRouter } from './Routers/AudiencesRouter';
|
||||
import { AggregateRouter } from './Routers/AggregateRouter';
|
||||
|
||||
import { ParseServerRESTController } from './ParseServerRESTController';
|
||||
import * as controllers from './Controllers';
|
||||
import { ParseGraphQLServer } from './GraphQL/ParseGraphQLServer';
|
||||
|
||||
// Mutate the Parse object to add the Cloud Code handlers
|
||||
addParseCloud();
|
||||
|
||||
@@ -264,6 +265,22 @@ class ParseServer {
|
||||
}
|
||||
|
||||
app.use(options.mountPath, this.app);
|
||||
|
||||
if (options.mountGraphQL === true || options.mountPlayground === true) {
|
||||
const parseGraphQLServer = new ParseGraphQLServer(this, {
|
||||
graphQLPath: options.graphQLPath,
|
||||
playgroundPath: options.playgroundPath,
|
||||
});
|
||||
|
||||
if (options.mountGraphQL) {
|
||||
parseGraphQLServer.applyGraphQL(app);
|
||||
}
|
||||
|
||||
if (options.mountPlayground) {
|
||||
parseGraphQLServer.applyPlayground(app);
|
||||
}
|
||||
}
|
||||
|
||||
const server = app.listen(options.port, options.host, callback);
|
||||
this.server = server;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user