Comparing version 3.0.0-alpha-640b0d8a.0 to 3.0.0-alpha-685d4ad2.0
@@ -1,2 +0,2 @@ | ||
import { Client } from 'graphql-ws'; | ||
import type { Client } from 'graphql-ws'; | ||
import type { Promisable } from 'type-fest'; | ||
@@ -3,0 +3,0 @@ import { GQtyError } from '../../Error'; |
@@ -5,3 +5,2 @@ 'use strict'; | ||
const graphqlWs = require('graphql-ws'); | ||
const index = require('../../Error/index.js'); | ||
@@ -29,3 +28,3 @@ | ||
dispatchEvent("message", { | ||
type: graphqlWs.MessageType.ConnectionAck | ||
type: "connection_ack" | ||
}); | ||
@@ -60,3 +59,3 @@ }, | ||
id: operationId, | ||
type: graphqlWs.MessageType.Subscribe, | ||
type: "subscribe", | ||
payload | ||
@@ -70,3 +69,3 @@ }); | ||
id: sub.operationId, | ||
type: graphqlWs.MessageType.Subscribe, | ||
type: "subscribe", | ||
payload | ||
@@ -73,0 +72,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-685d4ad2.0", | ||
"description": "gqty client without queries", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
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
274683
7879
18