Initial Sample.

This commit is contained in:
2024-06-03 20:23:50 +05:30
parent ef2b65f673
commit 5269ec3c66
2575 changed files with 282312 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import * as PropTypes from "prop-types";
import type * as ReactTypes from "react";
import type { OperationVariables } from "../../core/index.js";
import type { MutationComponentOptions } from "./types.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export declare function Mutation<TData = any, TVariables = OperationVariables>(props: MutationComponentOptions<TData, TVariables>): ReactTypes.JSX.Element | null;
export declare namespace Mutation {
var propTypes: PropTypes.InferProps<MutationComponentOptions<any, any, import("../../core/types.js").DefaultContext, import("../../core/index.js").ApolloCache<any>>>;
}
export interface Mutation<TData, TVariables> {
propTypes: PropTypes.InferProps<MutationComponentOptions<TData, TVariables>>;
}
//# sourceMappingURL=Mutation.d.ts.map

View File

@@ -0,0 +1,28 @@
import * as PropTypes from "prop-types";
import { useMutation } from "../hooks/index.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export function Mutation(props) {
var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
return props.children ? props.children(runMutation, result) : null;
}
Mutation.propTypes = {
mutation: PropTypes.object.isRequired,
variables: PropTypes.object,
optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
refetchQueries: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
PropTypes.func,
]),
awaitRefetchQueries: PropTypes.bool,
update: PropTypes.func,
children: PropTypes.func.isRequired,
onCompleted: PropTypes.func,
onError: PropTypes.func,
fetchPolicy: PropTypes.string,
};
//# sourceMappingURL=Mutation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../../../src/react/components/Mutation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAkD;IAE5C,IAAA,KAAwB,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAzD,WAAW,QAAA,EAAE,MAAM,QAAsC,CAAC;IACjE,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC;AAMD,QAAQ,CAAC,SAAS,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACrC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,kBAAkB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IAC3E,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC;QAClC,SAAS,CAAC,OAAO,CACf,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAC1D;QACD,SAAS,CAAC,IAAI;KACf,CAAC;IACF,mBAAmB,EAAE,SAAS,CAAC,IAAI;IACnC,MAAM,EAAE,SAAS,CAAC,IAAI;IACtB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,WAAW,EAAE,SAAS,CAAC,MAAM;CACK,CAAC","sourcesContent":["import * as PropTypes from \"prop-types\";\nimport type * as ReactTypes from \"react\";\n\nimport type { OperationVariables } from \"../../core/index.js\";\nimport type { MutationComponentOptions } from \"./types.js\";\nimport { useMutation } from \"../hooks/index.js\";\n\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Mutation<TData = any, TVariables = OperationVariables>(\n props: MutationComponentOptions<TData, TVariables>\n): ReactTypes.JSX.Element | null {\n const [runMutation, result] = useMutation(props.mutation, props);\n return props.children ? props.children(runMutation, result) : null;\n}\n\nexport interface Mutation<TData, TVariables> {\n propTypes: PropTypes.InferProps<MutationComponentOptions<TData, TVariables>>;\n}\n\nMutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.string, PropTypes.object])\n ),\n PropTypes.func,\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n} as Mutation<any, any>[\"propTypes\"];\n"]}

View File

@@ -0,0 +1,18 @@
import * as PropTypes from "prop-types";
import type * as ReactTypes from "react";
import type { OperationVariables } from "../../core/index.js";
import type { QueryComponentOptions } from "./types.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export declare function Query<TData = any, TVariables extends OperationVariables = OperationVariables>(props: QueryComponentOptions<TData, TVariables>): ReactTypes.JSX.Element | null;
export declare namespace Query {
var propTypes: PropTypes.InferProps<QueryComponentOptions<any, any>>;
}
export interface Query<TData, TVariables extends OperationVariables> {
propTypes: PropTypes.InferProps<QueryComponentOptions<TData, TVariables>>;
}
//# sourceMappingURL=Query.d.ts.map

View File

@@ -0,0 +1,29 @@
import { __rest } from "tslib";
import * as PropTypes from "prop-types";
import { useQuery } from "../hooks/index.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export function Query(props) {
var children = props.children, query = props.query, options = __rest(props, ["children", "query"]);
var result = useQuery(query, options);
return result ? children(result) : null;
}
Query.propTypes = {
client: PropTypes.object,
children: PropTypes.func.isRequired,
fetchPolicy: PropTypes.string,
notifyOnNetworkStatusChange: PropTypes.bool,
onCompleted: PropTypes.func,
onError: PropTypes.func,
pollInterval: PropTypes.number,
query: PropTypes.object.isRequired,
variables: PropTypes.object,
ssr: PropTypes.bool,
partialRefetch: PropTypes.bool,
returnPartialData: PropTypes.bool,
};
//# sourceMappingURL=Query.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../src/react/components/Query.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAInB,KAA+C;IAEvC,IAAA,QAAQ,GAAwB,KAAK,SAA7B,EAAE,KAAK,GAAiB,KAAK,MAAtB,EAAK,OAAO,UAAK,KAAK,EAAvC,qBAA+B,CAAF,CAAW;IAC9C,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAMD,KAAK,CAAC,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,2BAA2B,EAAE,SAAS,CAAC,IAAI;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,GAAG,EAAE,SAAS,CAAC,IAAI;IACnB,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,iBAAiB,EAAE,SAAS,CAAC,IAAI;CACF,CAAC","sourcesContent":["import * as PropTypes from \"prop-types\";\nimport type * as ReactTypes from \"react\";\n\nimport type { OperationVariables } from \"../../core/index.js\";\nimport type { QueryComponentOptions } from \"./types.js\";\nimport { useQuery } from \"../hooks/index.js\";\n\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Query<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n props: QueryComponentOptions<TData, TVariables>\n): ReactTypes.JSX.Element | null {\n const { children, query, ...options } = props;\n const result = useQuery(query, options);\n return result ? children(result as any) : null;\n}\n\nexport interface Query<TData, TVariables extends OperationVariables> {\n propTypes: PropTypes.InferProps<QueryComponentOptions<TData, TVariables>>;\n}\n\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool,\n} as Query<any, any>[\"propTypes\"];\n"]}

View File

@@ -0,0 +1,18 @@
import * as PropTypes from "prop-types";
import type * as ReactTypes from "react";
import type { OperationVariables } from "../../core/index.js";
import type { SubscriptionComponentOptions } from "./types.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export declare function Subscription<TData = any, TVariables extends OperationVariables = OperationVariables>(props: SubscriptionComponentOptions<TData, TVariables>): ReactTypes.JSX.Element | null;
export declare namespace Subscription {
var propTypes: PropTypes.InferProps<SubscriptionComponentOptions<any, any>>;
}
export interface Subscription<TData, TVariables extends OperationVariables> {
propTypes: PropTypes.InferProps<SubscriptionComponentOptions<TData, TVariables>>;
}
//# sourceMappingURL=Subscription.d.ts.map

View File

@@ -0,0 +1,23 @@
import * as PropTypes from "prop-types";
import { useSubscription } from "../hooks/index.js";
/**
* @deprecated
* Official support for React Apollo render prop components ended in March 2020.
* This library is still included in the `@apollo/client` package,
* but it no longer receives feature updates or bug fixes.
*/
export function Subscription(props) {
var result = useSubscription(props.subscription, props);
return props.children && result ? props.children(result) : null;
}
Subscription.propTypes = {
subscription: PropTypes.object.isRequired,
variables: PropTypes.object,
children: PropTypes.func,
onSubscriptionData: PropTypes.func,
onData: PropTypes.func,
onSubscriptionComplete: PropTypes.func,
onComplete: PropTypes.func,
shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
};
//# sourceMappingURL=Subscription.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../src/react/components/Subscription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAKxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAI1B,KAAsD;IAEtD,IAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC;AAQD,YAAY,CAAC,SAAS,GAAG;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACzC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,kBAAkB,EAAE,SAAS,CAAC,IAAI;IAClC,MAAM,EAAE,SAAS,CAAC,IAAI;IACtB,sBAAsB,EAAE,SAAS,CAAC,IAAI;IACtC,UAAU,EAAE,SAAS,CAAC,IAAI;IAC1B,iBAAiB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CAClC,CAAC","sourcesContent":["import * as PropTypes from \"prop-types\";\nimport type * as ReactTypes from \"react\";\n\nimport type { OperationVariables } from \"../../core/index.js\";\nimport type { SubscriptionComponentOptions } from \"./types.js\";\nimport { useSubscription } from \"../hooks/index.js\";\n\n/**\n * @deprecated\n * Official support for React Apollo render prop components ended in March 2020.\n * This library is still included in the `@apollo/client` package,\n * but it no longer receives feature updates or bug fixes.\n */\nexport function Subscription<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n props: SubscriptionComponentOptions<TData, TVariables>\n): ReactTypes.JSX.Element | null {\n const result = useSubscription(props.subscription, props);\n return props.children && result ? props.children(result) : null;\n}\n\nexport interface Subscription<TData, TVariables extends OperationVariables> {\n propTypes: PropTypes.InferProps<\n SubscriptionComponentOptions<TData, TVariables>\n >;\n}\n\nSubscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n onComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n} as Subscription<any, any>[\"propTypes\"];\n"]}

View File

@@ -0,0 +1,81 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var tslib = require('tslib');
var PropTypes = require('prop-types');
var hooks = require('../hooks');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
for (var k in e) {
n[k] = e[k];
}
}
n["default"] = e;
return Object.freeze(n);
}
var PropTypes__namespace = /*#__PURE__*/_interopNamespace(PropTypes);
function Query(props) {
var children = props.children, query = props.query, options = tslib.__rest(props, ["children", "query"]);
var result = hooks.useQuery(query, options);
return result ? children(result) : null;
}
Query.propTypes = {
client: PropTypes__namespace.object,
children: PropTypes__namespace.func.isRequired,
fetchPolicy: PropTypes__namespace.string,
notifyOnNetworkStatusChange: PropTypes__namespace.bool,
onCompleted: PropTypes__namespace.func,
onError: PropTypes__namespace.func,
pollInterval: PropTypes__namespace.number,
query: PropTypes__namespace.object.isRequired,
variables: PropTypes__namespace.object,
ssr: PropTypes__namespace.bool,
partialRefetch: PropTypes__namespace.bool,
returnPartialData: PropTypes__namespace.bool,
};
function Mutation(props) {
var _a = hooks.useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
return props.children ? props.children(runMutation, result) : null;
}
Mutation.propTypes = {
mutation: PropTypes__namespace.object.isRequired,
variables: PropTypes__namespace.object,
optimisticResponse: PropTypes__namespace.oneOfType([PropTypes__namespace.object, PropTypes__namespace.func]),
refetchQueries: PropTypes__namespace.oneOfType([
PropTypes__namespace.arrayOf(PropTypes__namespace.oneOfType([PropTypes__namespace.string, PropTypes__namespace.object])),
PropTypes__namespace.func,
]),
awaitRefetchQueries: PropTypes__namespace.bool,
update: PropTypes__namespace.func,
children: PropTypes__namespace.func.isRequired,
onCompleted: PropTypes__namespace.func,
onError: PropTypes__namespace.func,
fetchPolicy: PropTypes__namespace.string,
};
function Subscription(props) {
var result = hooks.useSubscription(props.subscription, props);
return props.children && result ? props.children(result) : null;
}
Subscription.propTypes = {
subscription: PropTypes__namespace.object.isRequired,
variables: PropTypes__namespace.object,
children: PropTypes__namespace.func,
onSubscriptionData: PropTypes__namespace.func,
onData: PropTypes__namespace.func,
onSubscriptionComplete: PropTypes__namespace.func,
onComplete: PropTypes__namespace.func,
shouldResubscribe: PropTypes__namespace.oneOfType([PropTypes__namespace.func, PropTypes__namespace.bool]),
};
exports.Mutation = Mutation;
exports.Query = Query;
exports.Subscription = Subscription;
//# sourceMappingURL=components.cjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,81 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var tslib = require('tslib');
var PropTypes = require('prop-types');
var hooks = require('../hooks');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
for (var k in e) {
n[k] = e[k];
}
}
n["default"] = e;
return Object.freeze(n);
}
var PropTypes__namespace = /*#__PURE__*/_interopNamespace(PropTypes);
function Query(props) {
var children = props.children, query = props.query, options = tslib.__rest(props, ["children", "query"]);
var result = hooks.useQuery(query, options);
return result ? children(result) : null;
}
Query.propTypes = {
client: PropTypes__namespace.object,
children: PropTypes__namespace.func.isRequired,
fetchPolicy: PropTypes__namespace.string,
notifyOnNetworkStatusChange: PropTypes__namespace.bool,
onCompleted: PropTypes__namespace.func,
onError: PropTypes__namespace.func,
pollInterval: PropTypes__namespace.number,
query: PropTypes__namespace.object.isRequired,
variables: PropTypes__namespace.object,
ssr: PropTypes__namespace.bool,
partialRefetch: PropTypes__namespace.bool,
returnPartialData: PropTypes__namespace.bool,
};
function Mutation(props) {
var _a = hooks.useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
return props.children ? props.children(runMutation, result) : null;
}
Mutation.propTypes = {
mutation: PropTypes__namespace.object.isRequired,
variables: PropTypes__namespace.object,
optimisticResponse: PropTypes__namespace.oneOfType([PropTypes__namespace.object, PropTypes__namespace.func]),
refetchQueries: PropTypes__namespace.oneOfType([
PropTypes__namespace.arrayOf(PropTypes__namespace.oneOfType([PropTypes__namespace.string, PropTypes__namespace.object])),
PropTypes__namespace.func,
]),
awaitRefetchQueries: PropTypes__namespace.bool,
update: PropTypes__namespace.func,
children: PropTypes__namespace.func.isRequired,
onCompleted: PropTypes__namespace.func,
onError: PropTypes__namespace.func,
fetchPolicy: PropTypes__namespace.string,
};
function Subscription(props) {
var result = hooks.useSubscription(props.subscription, props);
return props.children && result ? props.children(result) : null;
}
Subscription.propTypes = {
subscription: PropTypes__namespace.object.isRequired,
variables: PropTypes__namespace.object,
children: PropTypes__namespace.func,
onSubscriptionData: PropTypes__namespace.func,
onData: PropTypes__namespace.func,
onSubscriptionComplete: PropTypes__namespace.func,
onComplete: PropTypes__namespace.func,
shouldResubscribe: PropTypes__namespace.oneOfType([PropTypes__namespace.func, PropTypes__namespace.bool]),
};
exports.Mutation = Mutation;
exports.Query = Query;
exports.Subscription = Subscription;
//# sourceMappingURL=components.cjs.map

View File

@@ -0,0 +1,5 @@
export { Query } from "./Query.js";
export { Mutation } from "./Mutation.js";
export { Subscription } from "./Subscription.js";
export * from "./types.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,5 @@
export { Query } from "./Query.js";
export { Mutation } from "./Mutation.js";
export { Subscription } from "./Subscription.js";
export * from "./types.js";
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,cAAc,YAAY,CAAC","sourcesContent":["export { Query } from \"./Query.js\";\nexport { Mutation } from \"./Mutation.js\";\nexport { Subscription } from \"./Subscription.js\";\n\nexport * from \"./types.js\";\n"]}

View File

@@ -0,0 +1,8 @@
{
"name": "@apollo/client/react/components",
"type": "module",
"main": "components.cjs",
"module": "index.js",
"types": "index.d.ts",
"sideEffects": false
}

View File

@@ -0,0 +1,21 @@
import type { DocumentNode } from "graphql";
import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
import type * as ReactTypes from "react";
import type { OperationVariables, DefaultContext, ApolloCache } from "../../core/index.js";
import type { QueryFunctionOptions, QueryResult, BaseMutationOptions, MutationFunction, MutationResult, BaseSubscriptionOptions, SubscriptionResult } from "../types/types.js";
export interface QueryComponentOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends QueryFunctionOptions<TData, TVariables> {
children: (result: QueryResult<TData, TVariables>) => ReactTypes.JSX.Element | null;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
}
export interface MutationComponentOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
children: (mutateFunction: MutationFunction<TData, TVariables, TContext>, result: MutationResult<TData>) => ReactTypes.JSX.Element | null;
}
export interface SubscriptionComponentOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseSubscriptionOptions<TData, TVariables> {
/**
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single subscription inside of it.
*/
subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;
children?: null | ((result: SubscriptionResult<TData>) => ReactTypes.JSX.Element | null);
}
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DocumentNode } from \"graphql\";\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\n\nimport type * as ReactTypes from \"react\";\n\nimport type {\n OperationVariables,\n DefaultContext,\n ApolloCache,\n} from \"../../core/index.js\";\nimport type {\n QueryFunctionOptions,\n QueryResult,\n BaseMutationOptions,\n MutationFunction,\n MutationResult,\n BaseSubscriptionOptions,\n SubscriptionResult,\n} from \"../types/types.js\";\n\nexport interface QueryComponentOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {\n children: (\n result: QueryResult<TData, TVariables>\n ) => ReactTypes.JSX.Element | null;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationComponentOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children: (\n mutateFunction: MutationFunction<TData, TVariables, TContext>,\n result: MutationResult<TData>\n ) => ReactTypes.JSX.Element | null;\n}\n\nexport interface SubscriptionComponentOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {\n /** {@inheritDoc @apollo/client!SubscriptionOptionsDocumentation#query:member} */\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?:\n | null\n | ((result: SubscriptionResult<TData>) => ReactTypes.JSX.Element | null);\n}\n"]}