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

Function toGraphQLError

src/GraphQL/parseGraphQLUtils.js:15–25  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

13}
14
15export function toGraphQLError(error) {
16 let code, message;
17 if (error instanceof Parse.Error) {
18 code = error.code;
19 message = error.message;
20 } else {
21 code = Parse.Error.INTERNAL_SERVER_ERROR;
22 message = 'Internal server error';
23 }
24 return new GraphQLError(message, { extensions: { code } });
25}
26
27export const extractKeysAndInclude = selectedFields => {
28 selectedFields = selectedFields.filter(field => !field.includes('__typename'));

Callers 1

handleErrorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…