-
Is it possible to integrate envelop into parse server? part of parse server graphql applyGraphQL(app) {
if (!app || !app.use) {
requiredParameter('You must provide an Express.js app instance!');
}
app.use(
this.config.graphQLPath,
graphqlUploadExpress({
maxFileSize: this._transformMaxUploadSizeToBytes(
this.parseServer.config.maxUploadSize || '20mb'
),
})
);
app.use(this.config.graphQLPath, corsMiddleware());
app.use(this.config.graphQLPath, bodyParser.json());
app.use(this.config.graphQLPath, handleParseHeaders);
app.use(this.config.graphQLPath, handleParseErrors);
app.use(
this.config.graphQLPath,
graphqlExpress(async req => await this._getGraphQLOptions(req))
);
}
async _getGraphQLOptions(req) {
try {
return {
schema: await this.parseGraphQLSchema.load(),
context: {
info: req.info,
config: req.config,
auth: req.auth,
},
formatError: error => {
// Allow to console.log here to debug
return error;
},
};
} catch (e) {
this.log.error(e.stack || (typeof e.toString === 'function' && e.toString()) || e);
throw e;
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
Urigo
Feb 28, 2022
Replies: 1 comment
-
@tk2232 would be great to revive this PR we've done long time ago: parse-community/parse-server#7394 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
n1ru4l
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tk2232 would be great to revive this PR we've done long time ago: parse-community/parse-server#7394