| 10 | }; |
| 11 | |
| 12 | const 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 | |
| 51 | export { GLOBAL_ID_ATT, load }; |
nothing calls this directly
no test coverage detected
searching dependent graphs…