@m1212e/rumble 0.18.0 → 0.18.1

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/README.md CHANGED
@@ -289,6 +289,7 @@ server.listen(3000, () => {
289
289
  });
290
290
 
291
291
  ```
292
+ > If you hit `Query depth limit of N exceeded` (or alias/directive/token limit) errors in production, pass `armorConfig` through to relax the [graphql-armor](https://github.com/Escape-Technologies/graphql-armor) defaults — e.g. `createYoga({ armorConfig: { maxDepth: { n: 20 } } })`. `armorConfig` is forwarded verbatim to `EnvelopArmorPlugin(...)` and is only applied when `enableApiDocs` is `false` (i.e. in production).
292
293
 
293
294
  ## Usage & client generation
294
295
  You can use the GraphQL api with any client you like. However, rumble provides a generation api which can output a TypeScript client from a rumble instance. To perform a generation, use the exported function from your rumble instance like this:
@@ -347,7 +348,6 @@ users.subscribe((s) => s?.at(0));
347
348
  console.log(users.firstName)
348
349
  ```
349
350
 
350
- > **Error handling**: when the server returns a GraphQL error or a network error occurs, the returned promise rejects with the error. Use `await` (inside try/catch) or `.catch()` to handle it. If you use the fire-and-subscribe pattern (`const r = client.liveQuery.users(…); r.subscribe(…)`) without awaiting, a server error will produce an **unhandled promise rejection** — attach `.catch(() => {})` if you intentionally do not care about the promise result.
351
351
  > As of `v0.16.12` the client has special support for the svelte reactive state system (runes). If you run a live query which deploys a subscription inside a svelte effect context, you will get reactivity without subscribing to anything right out of the box. Please see [here](https://github.com/DeutscheModelUnitedNations/munify-chase/blob/f70c4484a92551b564c70603ebfd48d5b8cac637/src/lib/api/customClient.ts#L12) and [here](https://github.com/DeutscheModelUnitedNations/munify-chase/blob/f70c4484a92551b564c70603ebfd48d5b8cac637/src/routes/app/(launcher)/%2Bpage.svelte#L9C9-L9C23) for real world examples.
352
352
  ### Alternative decoupled client generation
353
353
  As an alternative to use the client generator with a fully instanciated rumble instance, you can also import the `generateFromSchema` function from rumble and pass it a standard `GraphQLSchema` object to generate the client:
package/out/index.cjs CHANGED
@@ -208,7 +208,7 @@ function mapNullFieldsToUndefined(obj) {
208
208
  }
209
209
  //#endregion
210
210
  //#region package.json
211
- var version = "0.18.0";
211
+ var version = "0.18.1";
212
212
  //#endregion
213
213
  //#region lib/helpers/mergeFilters.ts
214
214
  function mergeFilters(filterA, filterB) {
@@ -1753,7 +1753,7 @@ export const db = drizzle(
1753
1753
  context,
1754
1754
  plugins: [
1755
1755
  ...args?.plugins ?? [],
1756
- ...enableApiDocs ? [] : [(0, _graphql_yoga_plugin_disable_introspection.useDisableIntrospection)(), (0, _escape_tech_graphql_armor.EnvelopArmorPlugin)()],
1756
+ ...enableApiDocs ? [] : [(0, _graphql_yoga_plugin_disable_introspection.useDisableIntrospection)(), (0, _escape_tech_graphql_armor.EnvelopArmorPlugin)(args?.armorConfig)],
1757
1757
  rumbleInput.otel?.enabled ? { onExecute: ({ setExecuteFn, executeFn }) => {
1758
1758
  setExecuteFn((options) => rumbleInput.otel.tracer.startActiveSpan(_pothos_tracing_opentelemetry.SpanNames.EXECUTE, { attributes: {
1759
1759
  [_pothos_tracing_opentelemetry.AttributeNames.OPERATION_NAME]: options.operationName ?? "anonymous",