@m1212e/rumble 0.16.22 → 0.16.23

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 CHANGED
@@ -218,7 +218,7 @@ function mapNullFieldsToUndefined(obj) {
218
218
 
219
219
  //#endregion
220
220
  //#region package.json
221
- var version = "0.16.22";
221
+ var version = "0.16.23";
222
222
 
223
223
  //#endregion
224
224
  //#region lib/helpers/mergeFilters.ts
@@ -1645,27 +1645,76 @@ export const db = drizzle(
1645
1645
  plugins: [
1646
1646
  ...args?.plugins ?? [],
1647
1647
  ...enableApiDocs ? [] : [(0, _graphql_yoga_plugin_disable_introspection.useDisableIntrospection)(), (0, _escape_tech_graphql_armor.EnvelopArmorPlugin)()],
1648
- rumbleInput.otel?.enabled ? { onExecute: ({ setExecuteFn, executeFn }) => {
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) => {
1653
- try {
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);
1648
+ rumbleInput.otel?.enabled ? {
1649
+ onExecute: ({ setExecuteFn, executeFn }) => {
1650
+ setExecuteFn((options) => rumbleInput.otel.tracer.startActiveSpan(_pothos_tracing_opentelemetry.SpanNames.EXECUTE, { attributes: {
1651
+ [_pothos_tracing_opentelemetry.AttributeNames.OPERATION_NAME]: options.operationName ?? "anonymous",
1652
+ [_pothos_tracing_opentelemetry.AttributeNames.SOURCE]: options.document
1653
+ } }, async (span) => {
1654
+ try {
1655
+ const result = await executeFn(options);
1656
+ if (result && "errors" in result && result.errors?.length) {
1657
+ for (const error of result.errors) span.recordException(error);
1658
+ span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
1659
+ }
1660
+ return result;
1661
+ } catch (error) {
1662
+ if (error instanceof Error) span.recordException(error);
1657
1663
  span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
1664
+ throw error;
1665
+ } finally {
1666
+ span.end();
1658
1667
  }
1659
- return result;
1660
- } catch (error) {
1661
- if (error instanceof Error) span.recordException(error);
1662
- span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
1663
- throw error;
1664
- } finally {
1665
- span.end();
1666
- }
1667
- }));
1668
- } } : false
1668
+ }));
1669
+ },
1670
+ onParse: ({ setParseFn, parseFn }) => {
1671
+ setParseFn((...args) => rumbleInput.otel.tracer.startActiveSpan(_pothos_tracing_opentelemetry.SpanNames.PARSE, (span) => {
1672
+ try {
1673
+ return parseFn(...args);
1674
+ } catch (error) {
1675
+ if (error instanceof Error) span.recordException(error);
1676
+ span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
1677
+ throw error;
1678
+ } finally {
1679
+ span.end();
1680
+ }
1681
+ }));
1682
+ },
1683
+ onValidate: ({ setValidationFn, validateFn }) => {
1684
+ setValidationFn((...args) => rumbleInput.otel.tracer.startActiveSpan(_pothos_tracing_opentelemetry.SpanNames.VALIDATE, (span) => {
1685
+ try {
1686
+ const errors = validateFn(...args);
1687
+ if (errors.length > 0) {
1688
+ for (const error of errors) span.recordException(error);
1689
+ span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
1690
+ }
1691
+ return errors;
1692
+ } catch (error) {
1693
+ if (error instanceof Error) span.recordException(error);
1694
+ span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
1695
+ throw error;
1696
+ } finally {
1697
+ span.end();
1698
+ }
1699
+ }));
1700
+ },
1701
+ onSubscribe: ({ setSubscribeFn, subscribeFn }) => {
1702
+ setSubscribeFn((options) => rumbleInput.otel.tracer.startActiveSpan("graphql.subscribe", { attributes: {
1703
+ [_pothos_tracing_opentelemetry.AttributeNames.OPERATION_NAME]: options.operationName ?? "anonymous",
1704
+ [_pothos_tracing_opentelemetry.AttributeNames.SOURCE]: options.document
1705
+ } }, async (span) => {
1706
+ try {
1707
+ return await subscribeFn(options);
1708
+ } catch (error) {
1709
+ if (error instanceof Error) span.recordException(error);
1710
+ span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
1711
+ throw error;
1712
+ } finally {
1713
+ span.end();
1714
+ }
1715
+ }));
1716
+ }
1717
+ } : false
1669
1718
  ].filter(Boolean)
1670
1719
  });
1671
1720
  };