Skip to content

Releases: n1ru4l/graphql-live-query

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

Minor Changes

  • 93239dc: Drop the execute constructor argument option.
    Please use InMemoryLiveQueryStore.makeExecute instead.

    Old

    import { InMemoryLiveQueryStore } from "@n1ru4l/in-memory-live-query-store";
    import { execute as executeImplementation } from "graphql";
    const liveQueryStore = new InMemoryLiveQueryStore({ execute });
    const execute = liveQueryStore.execute;

    New

    import { InMemoryLiveQueryStore } from "@n1ru4l/in-memory-live-query-store";
    import { execute as executeImplementation } from "graphql";
    const liveQueryStore = new InMemoryLiveQueryStore();
    const execute = liveQueryStore.makeExecute(executeImplementation);
  • f585fb3: Support TypeScript ESM module resolution. More information on https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#ecmascript-module-support-in-node-js

Patch Changes

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

Minor Changes

Patch Changes

  • 25ad6d0: Ensure the data property reference changes for each published value in order to please GraphQL clients that rely on immutability.

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

Minor Changes

Patch Changes

@n1ru4l/[email protected]

29 Jul 09:27
8e3d221
Compare
Choose a tag to compare

Minor Changes

Patch Changes

@n1ru4l/[email protected]

31 Dec 15:06
b2bc861
Compare
Choose a tag to compare

Minor Changes

  • 727e806: The source returned from execute is now lazy and will only start emitting values once it is consumed. This prevents memory leaks.

    BREAKING: If the wrapped execute function returns a stream (e.g. because you forgot to add the NoLiveMixedWithDeferStreamRule validation rule) it causes the execute function to reject instead of publishing a ExecutionResult error payload. This change has been made in order to treat the error as unexpected and not leak any implementation details to the clients.

  • aee5d58: Allow setting custom invalidation indices.

    Until now doing granular or very specific index invalidations wasn't possible. Thus invalidation might not have been efficient enough, as either too many or too few live query operation "subscriptions" got invalidated.

    The new indexBy configuration option for the InMemoryLiveQueryStore, allows configuring specific indices suitable for the consumed GraphQL schema, resulting more granular and efficient invalidations.

    Invalidate by single field with arguments:

    const store = new InMemoryLiveQueryStore({
      includeIdentifierExtension: true,
      indexBy: [
        {
          field: "Query.posts",
          args: ["needle"]
        }
      ]
    });
    
    const execute = store.makeExecute(executeImplementation);
    
    const document = parse(/* GraphQL */ `
      query @live {
        posts(needle: "skrrrrt") {
          id
          title
        }
      }
    `);
    
    const executionResult = execute({ document, schema });
    
    let result = await executionResult.next();
    expect(result.value).toEqual({
      data: {
        posts: []
      },
      extensions: {
        liveResourceIdentifier: ["Query.posts", 'Query.posts(needle:"skrrrrt")']
      },
      isLive: true
    });

    Invalidation by single field with specific arguments:

    const store = new InMemoryLiveQueryStore({
      includeIdentifierExtension: true,
      indexBy: [
        {
          field: "Query.posts",
          // index will only be used if the needle argument value equals "brrrrt"
          args: [["needle", "brrrrt"]]
        }
      ]
    });

@n1ru4l/[email protected]

31 Dec 15:06
b2bc861
Compare
Choose a tag to compare

Patch Changes

  • 727e806: fix memory leak cause by AsyncIterables not being disposed properly.