+5
.changeset/curly-bees-rhyme.md
+5
.changeset/curly-bees-rhyme.md
···+Return a new `OperationResultSource` from all `Client` methods (which replaces `PromisifiedSource` on shortcut methods). This allows not only `toPromise()` to be called, but it can also be used as an awaitable `PromiseLike` and has a `.subscribe(onResult)` method aliasing the subscribe utility from `wonka`.
+49
-52
packages/core/src/client.ts
+49
-52
packages/core/src/client.ts
······/** Creates a `Source` that executes the GraphQL query operation created from the passed parameters.* @param opts - {@link OperationContext} options that'll override and be merged with options from the {@link ClientOptions}.-* @returns A {@link PromisifiedSource} issuing the {@link OperationResult | OperationResults} for the GraphQL operation.+* @returns A {@link OperationResultSource} issuing the {@link OperationResult | OperationResults} for the GraphQL operation.* The `Client.query` method is useful to programmatically create and issue a GraphQL query operation.-* Since it returns a {@link PromisifiedSource} it may be chained with a `toPromise()` call to only+* Since it returns a {@link OperationResultSource} it may be chained with a `toPromise()` call to only* Hint: This is the recommended way to create queries programmatically when not using the bindings,······/** Creates a `Source` that executes the GraphQL subscription operation created from the passed parameters.···/** Creates a `Source` that executes the GraphQL subscription operation for the passed `GraphQLRequest`.···/** Creates a `Source` that executes the GraphQL mutation operation created from the passed parameters.···/** Creates a `Source` that executes the GraphQL mutation operation for the passed `GraphQLRequest`.············
+22
-8
packages/core/src/types.ts
+22
-8
packages/core/src/types.ts
······-/** A `Source` with a `PromisifiedSource.toPromise` helper method, to promisify a single result.+/** A source of {@link OperationResult | OperationResults}, convertable to a promise, subscribable, or Wonka Source.-* The {@link Client} will often return a `PromisifiedSource` to provide the `toPromise` method. When called, this returns-* a promise of the source that resolves on the first {@link OperationResult} of the `Source` that doesn't have `stale: true`-* nor `hasNext: true` set, meaning, it'll resolve to the first result that is stable and complete.+* The {@link Client} will often return a `OperationResultSource` to provide a more flexible Wonka {@link Source}.+* While a {@link Source} may require you to import helpers to convert it to a `Promise` for a single result, or+* to subscribe to it, the `OperationResultSource` is a `PromiseLike` and has methods to convert it to a promise,+/** Alias for Wonka's `subscribe` and calls `onResult` when subscribed to for each new `OperationResult`. *//** A type of Operation, either a GraphQL `query`, `mutation`, or `subscription`; or a `teardown` signal.
+11
-7
packages/core/src/utils/streamUtils.ts
+11
-7
packages/core/src/utils/streamUtils.ts
······
+4
-1
packages/vue-urql/src/useMutation.test.ts
+4
-1
packages/vue-urql/src/useMutation.test.ts
······
+7
-2
packages/vue-urql/src/useQuery.test.ts
+7
-2
packages/vue-urql/src/useQuery.test.ts
·········
+10
-3
packages/vue-urql/src/useSubscription.test.ts
+10
-3
packages/vue-urql/src/useSubscription.test.ts
············