{"version":3,"sources":["../src/error.ts"],"sourcesContent":["/**\n * Based on https://github.com/graphql/graphql-js/blob/master/src/error/GraphQLError.js\n */\n\nimport {\n  GraphQLError as UpstreamGraphQLError,\n  type SourceLocation\n} from \"graphql\";\n\nexport function GraphQLError(\n  message: string,\n  locations?: ReadonlyArray<SourceLocation>,\n  path?: ReadonlyArray<string | number>,\n  originalError?: Error & { extensions?: any },\n  skipStackCapturing?: boolean\n) {\n  const extensions = originalError && originalError.extensions;\n  Object.defineProperties(this, {\n    message: {\n      value: message,\n      enumerable: true\n    },\n    locations: {\n      value: locations || undefined,\n      enumerable: locations && locations.length > 0\n    },\n    path: {\n      value: path || undefined,\n      enumerable: Boolean(path)\n    },\n    originalError: {\n      value: originalError\n    },\n    extensions: {\n      // Coercing falsey values to undefined ensures they will not be included\n      // in JSON.stringify() when not provided.\n      value: extensions || undefined,\n      enumerable: Boolean(extensions)\n    }\n  });\n\n  // Include (non-enumerable) stack trace.\n  if (originalError && originalError.stack) {\n    Object.defineProperty(this, \"stack\", {\n      value: originalError.stack,\n      writable: true,\n      configurable: true\n    });\n  } else if (!skipStackCapturing) {\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, GraphQLError);\n    } else {\n      Object.defineProperty(this, \"stack\", {\n        value: Error().stack,\n        writable: true,\n        configurable: true\n      });\n    }\n  }\n}\n\n(GraphQLError as any).prototype = Object.create(\n  UpstreamGraphQLError.prototype,\n  {\n    constructor: { value: GraphQLError },\n    name: { value: \"GraphQLError\" }\n  }\n);\n"],"mappings":"AAIA;AAAA,EACE,gBAAgB;AAAA,OAEX;AAEA,SAAS,aACd,SACA,WACA,MACA,eACA,oBACA;AACA,QAAM,aAAa,iBAAiB,cAAc;AAClD,SAAO,iBAAiB,MAAM;AAAA,IAC5B,SAAS;AAAA,MACP,OAAO;AAAA,MACP,YAAY;AAAA,IACd;AAAA,IACA,WAAW;AAAA,MACT,OAAO,aAAa;AAAA,MACpB,YAAY,aAAa,UAAU,SAAS;AAAA,IAC9C;AAAA,IACA,MAAM;AAAA,MACJ,OAAO,QAAQ;AAAA,MACf,YAAY,QAAQ,IAAI;AAAA,IAC1B;AAAA,IACA,eAAe;AAAA,MACb,OAAO;AAAA,IACT;AAAA,IACA,YAAY;AAAA;AAAA;AAAA,MAGV,OAAO,cAAc;AAAA,MACrB,YAAY,QAAQ,UAAU;AAAA,IAChC;AAAA,EACF,CAAC;AAGD,MAAI,iBAAiB,cAAc,OAAO;AACxC,WAAO,eAAe,MAAM,SAAS;AAAA,MACnC,OAAO,cAAc;AAAA,MACrB,UAAU;AAAA,MACV,cAAc;AAAA,IAChB,CAAC;AAAA,EACH,WAAW,CAAC,oBAAoB;AAC9B,QAAI,MAAM,mBAAmB;AAC3B,YAAM,kBAAkB,MAAM,YAAY;AAAA,IAC5C,OAAO;AACL,aAAO,eAAe,MAAM,SAAS;AAAA,QACnC,OAAO,MAAM,EAAE;AAAA,QACf,UAAU;AAAA,QACV,cAAc;AAAA,MAChB,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEC,aAAqB,YAAY,OAAO;AAAA,EACvC,qBAAqB;AAAA,EACrB;AAAA,IACE,aAAa,EAAE,OAAO,aAAa;AAAA,IACnC,MAAM,EAAE,OAAO,eAAe;AAAA,EAChC;AACF;","names":[]}