GraphQL: Allow true GraphQL Schema Customization (#6360)
* Allow real GraphQL Schema via ParseServer.start * wip * working * tests ok * add tests about enum/input use case * Add async function based merge * Better naming * remove useless condition
This commit is contained in:
@@ -262,10 +262,12 @@ class ParseServer {
|
||||
|
||||
if (options.mountGraphQL === true || options.mountPlayground === true) {
|
||||
let graphQLCustomTypeDefs = undefined;
|
||||
if (options.graphQLSchema) {
|
||||
if (typeof options.graphQLSchema === 'string') {
|
||||
graphQLCustomTypeDefs = parse(
|
||||
fs.readFileSync(options.graphQLSchema, 'utf8')
|
||||
);
|
||||
} else if (typeof options.graphQLSchema === 'object') {
|
||||
graphQLCustomTypeDefs = options.graphQLSchema;
|
||||
}
|
||||
|
||||
const parseGraphQLServer = new ParseGraphQLServer(this, {
|
||||
|
||||
Reference in New Issue
Block a user