@isograph/react 0.0.0-main-3a36e9fb → 0.0.0-main-beecd3bf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/FragmentReference.js +1 -1
- package/dist/core/IsographEnvironment.d.ts +7 -5
- package/dist/core/IsographEnvironment.d.ts.map +1 -1
- package/dist/core/IsographEnvironment.js +7 -15
- package/dist/core/cache.d.ts +6 -2
- package/dist/core/cache.d.ts.map +1 -1
- package/dist/core/cache.js +75 -19
- package/dist/core/check.d.ts +1 -1
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/check.js +9 -4
- package/dist/core/entrypoint.d.ts +2 -0
- package/dist/core/entrypoint.d.ts.map +1 -1
- package/dist/core/garbageCollection.d.ts +2 -1
- package/dist/core/garbageCollection.d.ts.map +1 -1
- package/dist/core/garbageCollection.js +45 -11
- package/dist/core/logging.d.ts +2 -2
- package/dist/core/logging.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.d.ts.map +1 -1
- package/dist/core/makeNetworkRequest.js +8 -2
- package/dist/core/read.d.ts +4 -3
- package/dist/core/read.d.ts.map +1 -1
- package/dist/core/read.js +13 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/react/useImperativeReference.js +1 -1
- package/package.json +4 -4
- package/schema.graphql +1 -0
- package/src/core/FragmentReference.ts +1 -1
- package/src/core/IsographEnvironment.ts +15 -25
- package/src/core/cache.ts +106 -25
- package/src/core/check.ts +10 -5
- package/src/core/entrypoint.ts +2 -0
- package/src/core/garbageCollection.ts +71 -20
- package/src/core/logging.ts +2 -2
- package/src/core/makeNetworkRequest.ts +8 -1
- package/src/core/read.ts +25 -16
- package/src/index.ts +0 -1
- package/src/react/useImperativeReference.ts +1 -1
- package/src/tests/__isograph/Query/meName/entrypoint.ts +1 -0
- package/src/tests/__isograph/Query/meNameSuccessor/entrypoint.ts +1 -0
- package/src/tests/__isograph/Query/nodeField/entrypoint.ts +1 -0
- package/src/tests/__isograph/Query/subquery/entrypoint.ts +67 -0
- package/src/tests/__isograph/Query/subquery/output_type.ts +3 -0
- package/src/tests/__isograph/Query/subquery/param_type.ts +12 -0
- package/src/tests/__isograph/Query/subquery/parameters_type.ts +3 -0
- package/src/tests/__isograph/Query/subquery/resolver_reader.ts +47 -0
- package/src/tests/__isograph/iso.ts +10 -0
- package/src/tests/garbageCollection.test.ts +43 -36
- package/src/tests/meNameSuccessor.ts +5 -0
- package/src/tests/nodeQuery.ts +2 -0
- package/src/tests/normalizeData.test.ts +120 -0
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
DataId,
|
|
4
4
|
IsographEnvironment,
|
|
5
5
|
IsographStore,
|
|
6
|
-
ROOT_ID,
|
|
7
6
|
StoreRecord,
|
|
8
7
|
assertLink,
|
|
8
|
+
type Link,
|
|
9
|
+
type TypeName,
|
|
9
10
|
} from './IsographEnvironment';
|
|
10
11
|
import { getParentRecordKey } from './cache';
|
|
11
12
|
import { NormalizationAst } from './entrypoint';
|
|
@@ -13,6 +14,7 @@ import { NormalizationAst } from './entrypoint';
|
|
|
13
14
|
export type RetainedQuery = {
|
|
14
15
|
readonly normalizationAst: NormalizationAst;
|
|
15
16
|
readonly variables: {};
|
|
17
|
+
readonly root: Link;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
type DidUnretainSomeQuery = boolean;
|
|
@@ -42,7 +44,7 @@ export function retainQuery(
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export function garbageCollectEnvironment(environment: IsographEnvironment) {
|
|
45
|
-
const retainedIds =
|
|
47
|
+
const retainedIds: RetainedIds = {};
|
|
46
48
|
|
|
47
49
|
for (const query of environment.retainedQueries) {
|
|
48
50
|
recordReachableIds(environment.store, query, retainedIds);
|
|
@@ -51,31 +53,61 @@ export function garbageCollectEnvironment(environment: IsographEnvironment) {
|
|
|
51
53
|
recordReachableIds(environment.store, query, retainedIds);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
for (const
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
for (const typeName in environment.store) {
|
|
57
|
+
const dataById = environment.store[typeName];
|
|
58
|
+
if (dataById == null) continue;
|
|
59
|
+
const retainedTypeIds = retainedIds[typeName];
|
|
60
|
+
|
|
61
|
+
// delete all objects
|
|
62
|
+
if (retainedTypeIds == undefined || retainedTypeIds.size == 0) {
|
|
63
|
+
delete environment.store[typeName];
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
for (const dataId in dataById) {
|
|
68
|
+
if (!retainedTypeIds.has(dataId)) {
|
|
69
|
+
delete dataById[dataId];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (Object.keys(dataById).length === 0) {
|
|
74
|
+
delete environment.store[typeName];
|
|
57
75
|
}
|
|
58
76
|
}
|
|
59
77
|
}
|
|
60
78
|
|
|
79
|
+
interface RetainedIds {
|
|
80
|
+
[typeName: TypeName]: Set<DataId>;
|
|
81
|
+
}
|
|
82
|
+
|
|
61
83
|
function recordReachableIds(
|
|
62
84
|
store: IsographStore,
|
|
63
85
|
retainedQuery: RetainedQuery,
|
|
64
|
-
mutableRetainedIds:
|
|
86
|
+
mutableRetainedIds: RetainedIds,
|
|
65
87
|
) {
|
|
66
|
-
|
|
67
|
-
store
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
retainedQuery.
|
|
71
|
-
|
|
72
|
-
);
|
|
88
|
+
const record =
|
|
89
|
+
store[retainedQuery.root.__typename]?.[retainedQuery.root.__link];
|
|
90
|
+
|
|
91
|
+
const retainedRecordsIds = (mutableRetainedIds[
|
|
92
|
+
retainedQuery.root.__typename
|
|
93
|
+
] ??= new Set());
|
|
94
|
+
retainedRecordsIds.add(retainedQuery.root.__link);
|
|
95
|
+
|
|
96
|
+
if (record) {
|
|
97
|
+
recordReachableIdsFromRecord(
|
|
98
|
+
store,
|
|
99
|
+
record,
|
|
100
|
+
mutableRetainedIds,
|
|
101
|
+
retainedQuery.normalizationAst,
|
|
102
|
+
retainedQuery.variables,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
73
105
|
}
|
|
74
106
|
|
|
75
107
|
function recordReachableIdsFromRecord(
|
|
76
108
|
store: IsographStore,
|
|
77
109
|
currentRecord: StoreRecord,
|
|
78
|
-
mutableRetainedIds:
|
|
110
|
+
mutableRetainedIds: RetainedIds,
|
|
79
111
|
selections: NormalizationAst,
|
|
80
112
|
variables: Variables | null,
|
|
81
113
|
) {
|
|
@@ -85,25 +117,44 @@ function recordReachableIdsFromRecord(
|
|
|
85
117
|
const linkKey = getParentRecordKey(selection, variables ?? {});
|
|
86
118
|
const linkedFieldOrFields = currentRecord[linkKey];
|
|
87
119
|
|
|
88
|
-
const
|
|
120
|
+
const links: Link[] = [];
|
|
89
121
|
if (Array.isArray(linkedFieldOrFields)) {
|
|
90
122
|
for (const maybeLink of linkedFieldOrFields) {
|
|
91
123
|
const link = assertLink(maybeLink);
|
|
92
124
|
if (link != null) {
|
|
93
|
-
|
|
125
|
+
links.push(link);
|
|
94
126
|
}
|
|
95
127
|
}
|
|
96
128
|
} else {
|
|
97
129
|
const link = assertLink(linkedFieldOrFields);
|
|
98
130
|
if (link != null) {
|
|
99
|
-
|
|
131
|
+
links.push(link);
|
|
100
132
|
}
|
|
101
133
|
}
|
|
102
134
|
|
|
103
|
-
|
|
104
|
-
|
|
135
|
+
let typeStore =
|
|
136
|
+
selection.concreteType !== null
|
|
137
|
+
? store[selection.concreteType]
|
|
138
|
+
: null;
|
|
139
|
+
|
|
140
|
+
if (typeStore == null && selection.concreteType !== null) {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
for (const nextRecordLink of links) {
|
|
145
|
+
let __typename = nextRecordLink.__typename;
|
|
146
|
+
|
|
147
|
+
const resolvedTypeStore = typeStore ?? store[__typename];
|
|
148
|
+
|
|
149
|
+
if (resolvedTypeStore == null) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const nextRecord = resolvedTypeStore[nextRecordLink.__link];
|
|
105
154
|
if (nextRecord != null) {
|
|
106
|
-
mutableRetainedIds
|
|
155
|
+
const retainedRecordsIds = (mutableRetainedIds[__typename] ??=
|
|
156
|
+
new Set());
|
|
157
|
+
retainedRecordsIds.add(nextRecordLink.__link);
|
|
107
158
|
recordReachableIdsFromRecord(
|
|
108
159
|
store,
|
|
109
160
|
nextRecord,
|
package/src/core/logging.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
RefetchQueryNormalizationArtifact,
|
|
12
12
|
} from './entrypoint';
|
|
13
13
|
import { FragmentReference, Variables } from './FragmentReference';
|
|
14
|
-
import { NetworkResponseObject } from './cache';
|
|
14
|
+
import { NetworkResponseObject, type EncounteredIds } from './cache';
|
|
15
15
|
import { Arguments } from './util';
|
|
16
16
|
import { ReadDataResult } from './read';
|
|
17
17
|
import { CheckResult } from './check';
|
|
@@ -32,7 +32,7 @@ export type LogMessage =
|
|
|
32
32
|
| {
|
|
33
33
|
kind: 'AfterNormalization';
|
|
34
34
|
store: IsographStore;
|
|
35
|
-
encounteredIds:
|
|
35
|
+
encounteredIds: EncounteredIds;
|
|
36
36
|
}
|
|
37
37
|
| {
|
|
38
38
|
kind: 'DeepEqualityCheck';
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
retainQuery,
|
|
11
11
|
unretainQuery,
|
|
12
12
|
} from './garbageCollection';
|
|
13
|
-
import { IsographEnvironment } from './IsographEnvironment';
|
|
13
|
+
import { IsographEnvironment, ROOT_ID } from './IsographEnvironment';
|
|
14
14
|
import {
|
|
15
15
|
AnyError,
|
|
16
16
|
PromiseWrapper,
|
|
@@ -41,6 +41,10 @@ export function maybeMakeNetworkRequest(
|
|
|
41
41
|
environment,
|
|
42
42
|
artifact.networkRequestInfo.normalizationAst,
|
|
43
43
|
variables,
|
|
44
|
+
{
|
|
45
|
+
__link: ROOT_ID,
|
|
46
|
+
__typename: artifact.concreteType,
|
|
47
|
+
},
|
|
44
48
|
);
|
|
45
49
|
if (result.kind === 'EnoughData') {
|
|
46
50
|
return [wrapResolvedValue(undefined), () => {}];
|
|
@@ -88,6 +92,7 @@ export function makeNetworkRequest(
|
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
if (status.kind === 'UndisposedIncomplete') {
|
|
95
|
+
const root = { __link: ROOT_ID, __typename: artifact.concreteType };
|
|
91
96
|
normalizeData(
|
|
92
97
|
environment,
|
|
93
98
|
artifact.networkRequestInfo.normalizationAst,
|
|
@@ -96,10 +101,12 @@ export function makeNetworkRequest(
|
|
|
96
101
|
artifact.kind === 'Entrypoint'
|
|
97
102
|
? artifact.readerWithRefetchQueries.nestedRefetchQueries
|
|
98
103
|
: [],
|
|
104
|
+
root,
|
|
99
105
|
);
|
|
100
106
|
const retainedQuery = {
|
|
101
107
|
normalizationAst: artifact.networkRequestInfo.normalizationAst,
|
|
102
108
|
variables,
|
|
109
|
+
root,
|
|
103
110
|
};
|
|
104
111
|
status = {
|
|
105
112
|
kind: 'UndisposedComplete',
|
package/src/core/read.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getParentRecordKey,
|
|
3
|
+
insertIfNotExists,
|
|
4
|
+
onNextChangeToRecord,
|
|
5
|
+
type EncounteredIds,
|
|
6
|
+
} from './cache';
|
|
2
7
|
import { getOrCreateCachedComponent } from './componentCache';
|
|
3
8
|
import {
|
|
4
9
|
IsographEntrypoint,
|
|
@@ -12,8 +17,6 @@ import {
|
|
|
12
17
|
} from './FragmentReference';
|
|
13
18
|
import {
|
|
14
19
|
assertLink,
|
|
15
|
-
DataId,
|
|
16
|
-
defaultMissingFieldHandler,
|
|
17
20
|
getOrLoadIsographArtifact,
|
|
18
21
|
IsographEnvironment,
|
|
19
22
|
type Link,
|
|
@@ -33,7 +36,7 @@ import { CleanupFn } from '@isograph/disposable-types';
|
|
|
33
36
|
import { DEFAULT_SHOULD_FETCH_VALUE, FetchOptions } from './check';
|
|
34
37
|
|
|
35
38
|
export type WithEncounteredRecords<T> = {
|
|
36
|
-
readonly encounteredRecords:
|
|
39
|
+
readonly encounteredRecords: EncounteredIds;
|
|
37
40
|
readonly item: ExtractData<T>;
|
|
38
41
|
};
|
|
39
42
|
|
|
@@ -44,7 +47,7 @@ export function readButDoNotEvaluate<
|
|
|
44
47
|
fragmentReference: FragmentReference<TReadFromStore, unknown>,
|
|
45
48
|
networkRequestOptions: NetworkRequestReaderOptions,
|
|
46
49
|
): WithEncounteredRecords<TReadFromStore> {
|
|
47
|
-
const mutableEncounteredRecords = new
|
|
50
|
+
const mutableEncounteredRecords: EncounteredIds = new Map();
|
|
48
51
|
|
|
49
52
|
const readerWithRefetchQueries = readPromise(
|
|
50
53
|
fragmentReference.readerWithRefetchQueries,
|
|
@@ -99,7 +102,7 @@ export type ReadDataResult<TReadFromStore> =
|
|
|
99
102
|
| {
|
|
100
103
|
readonly kind: 'Success';
|
|
101
104
|
readonly data: ExtractData<TReadFromStore>;
|
|
102
|
-
readonly encounteredRecords:
|
|
105
|
+
readonly encounteredRecords: EncounteredIds;
|
|
103
106
|
}
|
|
104
107
|
| {
|
|
105
108
|
readonly kind: 'MissingData';
|
|
@@ -116,10 +119,14 @@ function readData<TReadFromStore>(
|
|
|
116
119
|
nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[],
|
|
117
120
|
networkRequest: PromiseWrapper<void, any>,
|
|
118
121
|
networkRequestOptions: NetworkRequestReaderOptions,
|
|
119
|
-
mutableEncounteredRecords:
|
|
122
|
+
mutableEncounteredRecords: EncounteredIds,
|
|
120
123
|
): ReadDataResult<TReadFromStore> {
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
const encounteredIds = insertIfNotExists(
|
|
125
|
+
mutableEncounteredRecords,
|
|
126
|
+
root.__typename,
|
|
127
|
+
);
|
|
128
|
+
encounteredIds.add(root.__link);
|
|
129
|
+
let storeRecord = environment.store[root.__typename]?.[root.__link];
|
|
123
130
|
if (storeRecord === undefined) {
|
|
124
131
|
return {
|
|
125
132
|
kind: 'MissingData',
|
|
@@ -179,6 +186,7 @@ function readData<TReadFromStore>(
|
|
|
179
186
|
results.push(null);
|
|
180
187
|
continue;
|
|
181
188
|
}
|
|
189
|
+
|
|
182
190
|
const result = readData(
|
|
183
191
|
environment,
|
|
184
192
|
field.selections,
|
|
@@ -248,10 +256,9 @@ function readData<TReadFromStore>(
|
|
|
248
256
|
|
|
249
257
|
if (link === undefined) {
|
|
250
258
|
// TODO make this configurable, and also generated and derived from the schema
|
|
251
|
-
const missingFieldHandler =
|
|
252
|
-
environment.missingFieldHandler ?? defaultMissingFieldHandler;
|
|
259
|
+
const missingFieldHandler = environment.missingFieldHandler;
|
|
253
260
|
|
|
254
|
-
const altLink = missingFieldHandler(
|
|
261
|
+
const altLink = missingFieldHandler?.(
|
|
255
262
|
storeRecord,
|
|
256
263
|
root,
|
|
257
264
|
field.fieldName,
|
|
@@ -464,7 +471,9 @@ function readData<TReadFromStore>(
|
|
|
464
471
|
|
|
465
472
|
return [
|
|
466
473
|
// Stable id
|
|
467
|
-
root.
|
|
474
|
+
root.__typename +
|
|
475
|
+
':' +
|
|
476
|
+
root.__link +
|
|
468
477
|
'/' +
|
|
469
478
|
field.name +
|
|
470
479
|
'/' +
|
|
@@ -496,7 +505,7 @@ function readData<TReadFromStore>(
|
|
|
496
505
|
} as const),
|
|
497
506
|
|
|
498
507
|
// TODO localVariables is not guaranteed to have an id field
|
|
499
|
-
root
|
|
508
|
+
root,
|
|
500
509
|
variables: localVariables,
|
|
501
510
|
networkRequest,
|
|
502
511
|
};
|
|
@@ -569,7 +578,7 @@ function readData<TReadFromStore>(
|
|
|
569
578
|
),
|
|
570
579
|
|
|
571
580
|
// TODO localVariables is not guaranteed to have an id field
|
|
572
|
-
root
|
|
581
|
+
root,
|
|
573
582
|
variables: localVariables,
|
|
574
583
|
networkRequest,
|
|
575
584
|
};
|
|
@@ -693,7 +702,7 @@ export function getNetworkRequestOptionsWithDefaults(
|
|
|
693
702
|
// TODO call stableStringifyArgs on the variable values, as well.
|
|
694
703
|
// This doesn't matter for now, since we are just using primitive values
|
|
695
704
|
// in the demo.
|
|
696
|
-
function stableStringifyArgs(args:
|
|
705
|
+
function stableStringifyArgs(args: object) {
|
|
697
706
|
const keys = Object.keys(args);
|
|
698
707
|
keys.sort();
|
|
699
708
|
let s = '';
|
package/src/index.ts
CHANGED
|
@@ -57,7 +57,7 @@ export function useImperativeReference<
|
|
|
57
57
|
nestedRefetchQueries:
|
|
58
58
|
entrypoint.readerWithRefetchQueries.nestedRefetchQueries,
|
|
59
59
|
}),
|
|
60
|
-
root: { __link: ROOT_ID },
|
|
60
|
+
root: { __link: ROOT_ID, __typename: entrypoint.concreteType },
|
|
61
61
|
variables,
|
|
62
62
|
networkRequest,
|
|
63
63
|
},
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type {IsographEntrypoint, NormalizationAst, RefetchQueryNormalizationArtifactWrapper} from '@isograph/react';
|
|
2
|
+
import {Query__subquery__param} from './param_type';
|
|
3
|
+
import {Query__subquery__output_type} from './output_type';
|
|
4
|
+
import readerResolver from './resolver_reader';
|
|
5
|
+
const nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[] = [];
|
|
6
|
+
|
|
7
|
+
const queryText = 'query subquery ($id: ID!) {\
|
|
8
|
+
query {\
|
|
9
|
+
node____id___v_id: node(id: $id) {\
|
|
10
|
+
__typename,\
|
|
11
|
+
id,\
|
|
12
|
+
},\
|
|
13
|
+
},\
|
|
14
|
+
}';
|
|
15
|
+
|
|
16
|
+
const normalizationAst: NormalizationAst = [
|
|
17
|
+
{
|
|
18
|
+
kind: "Linked",
|
|
19
|
+
fieldName: "query",
|
|
20
|
+
arguments: null,
|
|
21
|
+
concreteType: "Query",
|
|
22
|
+
selections: [
|
|
23
|
+
{
|
|
24
|
+
kind: "Linked",
|
|
25
|
+
fieldName: "node",
|
|
26
|
+
arguments: [
|
|
27
|
+
[
|
|
28
|
+
"id",
|
|
29
|
+
{ kind: "Variable", name: "id" },
|
|
30
|
+
],
|
|
31
|
+
],
|
|
32
|
+
concreteType: null,
|
|
33
|
+
selections: [
|
|
34
|
+
{
|
|
35
|
+
kind: "Scalar",
|
|
36
|
+
fieldName: "__typename",
|
|
37
|
+
arguments: null,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
kind: "Scalar",
|
|
41
|
+
fieldName: "id",
|
|
42
|
+
arguments: null,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
const artifact: IsographEntrypoint<
|
|
50
|
+
Query__subquery__param,
|
|
51
|
+
Query__subquery__output_type
|
|
52
|
+
> = {
|
|
53
|
+
kind: "Entrypoint",
|
|
54
|
+
networkRequestInfo: {
|
|
55
|
+
kind: "NetworkRequestInfo",
|
|
56
|
+
queryText,
|
|
57
|
+
normalizationAst,
|
|
58
|
+
},
|
|
59
|
+
concreteType: "Query",
|
|
60
|
+
readerWithRefetchQueries: {
|
|
61
|
+
kind: "ReaderWithRefetchQueries",
|
|
62
|
+
nestedRefetchQueries,
|
|
63
|
+
readerArtifact: readerResolver,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default artifact;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Query__subquery__parameters } from './parameters_type';
|
|
2
|
+
|
|
3
|
+
export type Query__subquery__param = {
|
|
4
|
+
readonly data: {
|
|
5
|
+
readonly query: {
|
|
6
|
+
readonly node: ({
|
|
7
|
+
readonly id: string,
|
|
8
|
+
} | null),
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
readonly parameters: Query__subquery__parameters,
|
|
12
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { EagerReaderArtifact, ReaderAst } from '@isograph/react';
|
|
2
|
+
import { Query__subquery__param } from './param_type';
|
|
3
|
+
import { Query__subquery__output_type } from './output_type';
|
|
4
|
+
import { subquery as resolver } from '../../../normalizeData.test';
|
|
5
|
+
|
|
6
|
+
const readerAst: ReaderAst<Query__subquery__param> = [
|
|
7
|
+
{
|
|
8
|
+
kind: "Linked",
|
|
9
|
+
fieldName: "query",
|
|
10
|
+
alias: null,
|
|
11
|
+
arguments: null,
|
|
12
|
+
condition: null,
|
|
13
|
+
selections: [
|
|
14
|
+
{
|
|
15
|
+
kind: "Linked",
|
|
16
|
+
fieldName: "node",
|
|
17
|
+
alias: null,
|
|
18
|
+
arguments: [
|
|
19
|
+
[
|
|
20
|
+
"id",
|
|
21
|
+
{ kind: "Variable", name: "id" },
|
|
22
|
+
],
|
|
23
|
+
],
|
|
24
|
+
condition: null,
|
|
25
|
+
selections: [
|
|
26
|
+
{
|
|
27
|
+
kind: "Scalar",
|
|
28
|
+
fieldName: "id",
|
|
29
|
+
alias: null,
|
|
30
|
+
arguments: null,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const artifact: EagerReaderArtifact<
|
|
39
|
+
Query__subquery__param,
|
|
40
|
+
Query__subquery__output_type
|
|
41
|
+
> = {
|
|
42
|
+
kind: "EagerReaderArtifact",
|
|
43
|
+
resolver,
|
|
44
|
+
readerAst,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default artifact;
|
|
@@ -2,9 +2,11 @@ import type { IsographEntrypoint } from '@isograph/react';
|
|
|
2
2
|
import { type Query__meNameSuccessor__param } from './Query/meNameSuccessor/param_type';
|
|
3
3
|
import { type Query__meName__param } from './Query/meName/param_type';
|
|
4
4
|
import { type Query__nodeField__param } from './Query/nodeField/param_type';
|
|
5
|
+
import { type Query__subquery__param } from './Query/subquery/param_type';
|
|
5
6
|
import entrypoint_Query__meNameSuccessor from '../__isograph/Query/meNameSuccessor/entrypoint';
|
|
6
7
|
import entrypoint_Query__meName from '../__isograph/Query/meName/entrypoint';
|
|
7
8
|
import entrypoint_Query__nodeField from '../__isograph/Query/nodeField/entrypoint';
|
|
9
|
+
import entrypoint_Query__subquery from '../__isograph/Query/subquery/entrypoint';
|
|
8
10
|
|
|
9
11
|
// This is the type given to regular client fields.
|
|
10
12
|
// This means that the type of the exported iso literal is exactly
|
|
@@ -66,6 +68,10 @@ export function iso<T>(
|
|
|
66
68
|
param: T & MatchesWhitespaceAndString<'field Query.nodeField', T>
|
|
67
69
|
): IdentityWithParam<Query__nodeField__param>;
|
|
68
70
|
|
|
71
|
+
export function iso<T>(
|
|
72
|
+
param: T & MatchesWhitespaceAndString<'field Query.subquery', T>
|
|
73
|
+
): IdentityWithParam<Query__subquery__param>;
|
|
74
|
+
|
|
69
75
|
export function iso<T>(
|
|
70
76
|
param: T & MatchesWhitespaceAndString<'entrypoint Query.meNameSuccessor', T>
|
|
71
77
|
): typeof entrypoint_Query__meNameSuccessor;
|
|
@@ -78,6 +84,10 @@ export function iso<T>(
|
|
|
78
84
|
param: T & MatchesWhitespaceAndString<'entrypoint Query.nodeField', T>
|
|
79
85
|
): typeof entrypoint_Query__nodeField;
|
|
80
86
|
|
|
87
|
+
export function iso<T>(
|
|
88
|
+
param: T & MatchesWhitespaceAndString<'entrypoint Query.subquery', T>
|
|
89
|
+
): typeof entrypoint_Query__subquery;
|
|
90
|
+
|
|
81
91
|
export function iso(_isographLiteralText: string):
|
|
82
92
|
| IdentityWithParam<any>
|
|
83
93
|
| IdentityWithParamComponent<any>
|