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

Function setupGraphQL

spec/GraphQLQueryComplexity.spec.js:22–35  ·  view source on GitHub ↗
(serverOptions = {})

Source from the content-addressed store, hash-verified

20 };
21
22 async function setupGraphQL(serverOptions = {}) {
23 if (httpServer) {
24 await new Promise(resolve => httpServer.close(resolve));
25 }
26 const server = await reconfigureServer(serverOptions);
27 const expressApp = express();
28 httpServer = http.createServer(expressApp);
29 expressApp.use('/parse', server.app);
30 graphQLServer = new ParseGraphQLServer(server, {
31 graphQLPath: '/graphql',
32 });
33 graphQLServer.applyGraphQL(expressApp);
34 await new Promise(resolve => httpServer.listen({ port: 13378 }, resolve));
35 }
36
37 async function graphqlRequest(query, requestHeaders = headers) {
38 const response = await fetch('http://localhost:13378/graphql', {

Callers 1

Calls 4

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

Tested by

no test coverage detected