@m1212e/rumble 0.16.20 → 0.16.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/index.cjs +32 -8
- package/out/index.cjs.map +1 -1
- package/out/index.d.cts.map +1 -1
- package/out/index.d.mts.map +1 -1
- package/out/index.mjs +33 -9
- package/out/index.mjs.map +1 -1
- package/package.json +1 -1
package/out/index.cjs
CHANGED
|
@@ -218,7 +218,7 @@ function mapNullFieldsToUndefined(obj) {
|
|
|
218
218
|
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region package.json
|
|
221
|
-
var version = "0.16.
|
|
221
|
+
var version = "0.16.22";
|
|
222
222
|
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region lib/helpers/mergeFilters.ts
|
|
@@ -1640,32 +1640,56 @@ export const db = drizzle(
|
|
|
1640
1640
|
return (0, graphql_yoga.createYoga)({
|
|
1641
1641
|
...args,
|
|
1642
1642
|
graphiql: enableApiDocs,
|
|
1643
|
+
schema: builtSchema(),
|
|
1644
|
+
context,
|
|
1643
1645
|
plugins: [
|
|
1644
1646
|
...args?.plugins ?? [],
|
|
1645
1647
|
...enableApiDocs ? [] : [(0, _graphql_yoga_plugin_disable_introspection.useDisableIntrospection)(), (0, _escape_tech_graphql_armor.EnvelopArmorPlugin)()],
|
|
1646
1648
|
rumbleInput.otel?.enabled ? { onExecute: ({ setExecuteFn, executeFn }) => {
|
|
1647
|
-
setExecuteFn((options) => rumbleInput.otel.tracer.startActiveSpan(_pothos_tracing_opentelemetry.SpanNames.EXECUTE, { attributes: {
|
|
1649
|
+
setExecuteFn((options) => rumbleInput.otel.tracer.startActiveSpan(_pothos_tracing_opentelemetry.SpanNames.EXECUTE, { attributes: {
|
|
1650
|
+
[_pothos_tracing_opentelemetry.AttributeNames.OPERATION_NAME]: options.operationName ?? "anonymous",
|
|
1651
|
+
[_pothos_tracing_opentelemetry.AttributeNames.SOURCE]: options.document
|
|
1652
|
+
} }, async (span) => {
|
|
1648
1653
|
try {
|
|
1649
|
-
|
|
1654
|
+
const result = await executeFn(options);
|
|
1655
|
+
if (result && "errors" in result && result.errors?.length) {
|
|
1656
|
+
for (const error of result.errors) span.recordException(error);
|
|
1657
|
+
span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
1658
|
+
}
|
|
1659
|
+
return result;
|
|
1650
1660
|
} catch (error) {
|
|
1651
|
-
span.recordException(error);
|
|
1661
|
+
if (error instanceof Error) span.recordException(error);
|
|
1662
|
+
span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
1652
1663
|
throw error;
|
|
1653
1664
|
} finally {
|
|
1654
1665
|
span.end();
|
|
1655
1666
|
}
|
|
1656
1667
|
}));
|
|
1657
1668
|
} } : false
|
|
1658
|
-
].filter(Boolean)
|
|
1659
|
-
schema: builtSchema(),
|
|
1660
|
-
context
|
|
1669
|
+
].filter(Boolean)
|
|
1661
1670
|
});
|
|
1662
1671
|
};
|
|
1663
1672
|
const createSofa = (args) => {
|
|
1664
1673
|
if (args.openAPI) (0, es_toolkit.merge)(args.openAPI, sofaOpenAPIWebhookDocs);
|
|
1674
|
+
if (args.errorHandler) {
|
|
1675
|
+
const originalHandler = args.errorHandler;
|
|
1676
|
+
args.errorHandler = (errors) => {
|
|
1677
|
+
const span = _opentelemetry_api.trace.getActiveSpan();
|
|
1678
|
+
for (const error of errors) span?.recordException(error);
|
|
1679
|
+
span?.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
1680
|
+
return originalHandler(errors);
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1665
1683
|
return (0, sofa_api.useSofa)({
|
|
1666
1684
|
...args,
|
|
1667
1685
|
schema: builtSchema(),
|
|
1668
|
-
context
|
|
1686
|
+
context,
|
|
1687
|
+
errorHandler(errors) {
|
|
1688
|
+
const span = _opentelemetry_api.trace.getActiveSpan();
|
|
1689
|
+
for (const error of errors) span?.recordException(error);
|
|
1690
|
+
span?.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
1691
|
+
return new Response(errors[0].message, { status: 500 });
|
|
1692
|
+
}
|
|
1669
1693
|
});
|
|
1670
1694
|
};
|
|
1671
1695
|
return {
|