MCPcopy
hub / github.com/parse-community/parse-server / setupGraphQLServer

Function setupGraphQLServer

spec/vulnerabilities.spec.js:3004–3019  ·  view source on GitHub ↗
(serverOptions = {}, graphQLOptions = {})

Source from the content-addressed store, hash-verified

3002 };
3003
3004 async function setupGraphQLServer(serverOptions = {}, graphQLOptions = {}) {
3005 if (httpServer) {
3006 await new Promise(resolve => httpServer.close(resolve));
3007 }
3008 const server = await reconfigureServer(serverOptions);
3009 const expressApp = express();
3010 httpServer = http.createServer(expressApp);
3011 expressApp.use('/parse', server.app);
3012 const parseGraphQLServer = new ParseGraphQLServer(server, {
3013 graphQLPath: '/graphql',
3014 ...graphQLOptions,
3015 });
3016 parseGraphQLServer.applyGraphQL(expressApp);
3017 await new Promise(resolve => httpServer.listen({ port: gqlPort }, resolve));
3018 return parseGraphQLServer;
3019 }
3020
3021 async function gqlRequest(query, headers = gqlHeaders) {
3022 const response = await fetch(`http://localhost:${gqlPort}/graphql`, {

Callers 1

Calls 4

applyGraphQLMethod · 0.95
reconfigureServerFunction · 0.85
createServerMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected