Comparing version 3.0.0-alpha-640b0d8a.0 to 3.0.0-alpha-895672eb.0
@@ -1,8 +0,8 @@ | ||
import type { BaseGeneratedSchema, FetchOptions } from '.'; | ||
import type { Cache } from '../Cache'; | ||
import type { GQtyError, RetryOptions } from '../Error'; | ||
import type { ScalarsEnumsHash, Schema } from '../Schema'; | ||
import type { Selection } from '../Selection'; | ||
import { type BaseGeneratedSchema, type FetchOptions } from '.'; | ||
import { type Cache } from '../Cache'; | ||
import { type GQtyError, type RetryOptions } from '../Error'; | ||
import { type ScalarsEnumsHash, type Schema } from '../Schema'; | ||
import { type Selection } from '../Selection'; | ||
import { SchemaContext } from './context'; | ||
import type { Debugger } from './debugger'; | ||
import { type Debugger } from './debugger'; | ||
import { Unsubscribe } from './resolveSelections'; | ||
@@ -63,7 +63,8 @@ export type CreateResolversOptions = { | ||
export type CreateResolverFn<TSchema extends BaseGeneratedSchema> = (options?: ResolveOptions) => ResolverParts<TSchema>; | ||
export type ResolveFn<TSchema extends BaseGeneratedSchema> = <TData extends Record<string, unknown> = Record<string, unknown>>(fn: DataFn<TSchema>, options?: ResolveOptions) => Promise<TData>; | ||
export type SubscribeFn<TSchema extends BaseGeneratedSchema> = <TData extends Record<string, unknown> = Record<string, unknown>>(fn: DataFn<TSchema>, options?: SubscribeOptions) => AsyncGenerator<TData, void, unknown> & { | ||
export type ResolveFn<TSchema extends BaseGeneratedSchema> = <TData extends unknown = unknown>(fn: DataFn<TSchema, TData>, options?: ResolveOptions) => Promise<DataResult<TData>>; | ||
export type SubscribeFn<TSchema extends BaseGeneratedSchema> = <TData extends unknown = unknown>(fn: DataFn<TSchema, TData>, options?: SubscribeOptions) => AsyncGenerator<DataResult<TData>, void, unknown> & { | ||
unsubscribe: Unsubscribe; | ||
}; | ||
export type DataFn<TSchema> = (schema: TSchema) => void; | ||
export type DataFn<TSchema, TResult = unknown> = (schema: TSchema) => TResult; | ||
export type DataResult<TData = unknown> = TData extends undefined ? TData : TData extends void ? unknown : TData; | ||
export type ResolveOptions = { | ||
@@ -70,0 +71,0 @@ /** |
@@ -51,2 +51,10 @@ 'use strict'; | ||
const resolve = async () => { | ||
if (selections.size === 0) { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn( | ||
"[GQty] No selections found. If you are reading from the global accessors, try using the first argument instead." | ||
); | ||
} | ||
return; | ||
} | ||
if (!context$1.shouldFetch) | ||
@@ -104,2 +112,11 @@ return; | ||
} = {}) => { | ||
if (selections.size === 0) { | ||
if (process.env.NODE_ENV !== "production") { | ||
console.warn( | ||
"[GQty] No selections found. If you are reading from the global accessors, try using the first argument instead." | ||
); | ||
} | ||
return () => { | ||
}; | ||
} | ||
const unsubscibers = /* @__PURE__ */ new Set(); | ||
@@ -106,0 +123,0 @@ const unsubscribe = () => { |
{ | ||
"name": "gqty", | ||
"version": "3.0.0-alpha-640b0d8a.0", | ||
"version": "3.0.0-alpha-895672eb.0", | ||
"description": "gqty client without queries", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274849
7881
18