MCPcopy Create free account
hub / github.com/parse-community/parse-server / load

Function load

src/GraphQL/loaders/defaultRelaySchema.js:12–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10};
11
12const load = parseGraphQLSchema => {
13 const { nodeInterface, nodeField } = nodeDefinitions(
14 async (globalId, context, queryInfo) => {
15 try {
16 const { type, id } = fromGlobalId(globalId);
17 const { config, auth, info } = context;
18 const selectedFields = getFieldNames(queryInfo);
19
20 const { keys, include } = extractKeysAndInclude(selectedFields);
21
22 return {
23 className: type,
24 ...(await objectsQueries.getObject(
25 type,
26 id,
27 keys,
28 include,
29 undefined,
30 undefined,
31 config,
32 auth,
33 info,
34 parseGraphQLSchema.parseClasses
35 )),
36 };
37 } catch (e) {
38 parseGraphQLSchema.handleError(e);
39 }
40 },
41 obj => {
42 return parseGraphQLSchema.parseClassTypes[obj.className].classGraphQLOutputType.name;
43 }
44 );
45
46 parseGraphQLSchema.addGraphQLType(nodeInterface, true);
47 parseGraphQLSchema.relayNodeInterface = nodeInterface;
48 parseGraphQLSchema.addGraphQLQuery('node', nodeField, true);
49};
50
51export { GLOBAL_ID_ATT, load };

Callers

nothing calls this directly

Calls 4

extractKeysAndIncludeFunction · 0.85
addGraphQLTypeMethod · 0.80
addGraphQLQueryMethod · 0.80
handleErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…