@isograph/react 0.3.0 → 0.4.0

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.
Files changed (164) hide show
  1. package/.turbo/turbo-compile-libs.log +5 -0
  2. package/dist/core/FragmentReference.d.ts +17 -8
  3. package/dist/core/FragmentReference.d.ts.map +1 -1
  4. package/dist/core/FragmentReference.js +3 -12
  5. package/dist/core/IsographEnvironment.d.ts +30 -35
  6. package/dist/core/IsographEnvironment.d.ts.map +1 -1
  7. package/dist/core/IsographEnvironment.js +4 -0
  8. package/dist/core/PromiseWrapper.d.ts +6 -7
  9. package/dist/core/PromiseWrapper.d.ts.map +1 -1
  10. package/dist/core/PromiseWrapper.js +6 -12
  11. package/dist/core/areEqualWithDeepComparison.d.ts +1 -3
  12. package/dist/core/areEqualWithDeepComparison.d.ts.map +1 -1
  13. package/dist/core/areEqualWithDeepComparison.js +16 -2
  14. package/dist/core/brand.d.ts +2 -0
  15. package/dist/core/brand.d.ts.map +1 -0
  16. package/dist/core/brand.js +2 -0
  17. package/dist/core/cache.d.ts +16 -24
  18. package/dist/core/cache.d.ts.map +1 -1
  19. package/dist/core/cache.js +105 -72
  20. package/dist/core/check.d.ts +11 -7
  21. package/dist/core/check.d.ts.map +1 -1
  22. package/dist/core/check.js +2 -2
  23. package/dist/core/componentCache.d.ts +1 -1
  24. package/dist/core/componentCache.d.ts.map +1 -1
  25. package/dist/core/componentCache.js +27 -31
  26. package/dist/core/entrypoint.d.ts +43 -28
  27. package/dist/core/entrypoint.d.ts.map +1 -1
  28. package/dist/core/garbageCollection.d.ts +5 -6
  29. package/dist/core/garbageCollection.d.ts.map +1 -1
  30. package/dist/core/garbageCollection.js +1 -1
  31. package/dist/core/logging.d.ts +23 -15
  32. package/dist/core/logging.d.ts.map +1 -1
  33. package/dist/core/logging.js +8 -5
  34. package/dist/core/makeNetworkRequest.d.ts +5 -5
  35. package/dist/core/makeNetworkRequest.d.ts.map +1 -1
  36. package/dist/core/makeNetworkRequest.js +113 -28
  37. package/dist/core/read.d.ts +16 -11
  38. package/dist/core/read.d.ts.map +1 -1
  39. package/dist/core/read.js +468 -305
  40. package/dist/core/reader.d.ts +33 -37
  41. package/dist/core/reader.d.ts.map +1 -1
  42. package/dist/core/startUpdate.d.ts +8 -0
  43. package/dist/core/startUpdate.d.ts.map +1 -0
  44. package/dist/core/startUpdate.js +163 -0
  45. package/dist/core/util.d.ts +3 -0
  46. package/dist/core/util.d.ts.map +1 -1
  47. package/dist/index.d.ts +18 -15
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +9 -1
  50. package/dist/loadable-hooks/useClientSideDefer.d.ts +4 -10
  51. package/dist/loadable-hooks/useClientSideDefer.d.ts.map +1 -1
  52. package/dist/loadable-hooks/useClientSideDefer.js +2 -2
  53. package/dist/loadable-hooks/useConnectionSpecPagination.d.ts +8 -15
  54. package/dist/loadable-hooks/useConnectionSpecPagination.d.ts.map +1 -1
  55. package/dist/loadable-hooks/useConnectionSpecPagination.js +6 -4
  56. package/dist/loadable-hooks/useImperativeExposedMutationField.d.ts +1 -2
  57. package/dist/loadable-hooks/useImperativeExposedMutationField.d.ts.map +1 -1
  58. package/dist/loadable-hooks/useImperativeLoadableField.d.ts +4 -6
  59. package/dist/loadable-hooks/useImperativeLoadableField.d.ts.map +1 -1
  60. package/dist/loadable-hooks/useImperativeLoadableField.js +1 -1
  61. package/dist/loadable-hooks/useSkipLimitPagination.d.ts +6 -13
  62. package/dist/loadable-hooks/useSkipLimitPagination.d.ts.map +1 -1
  63. package/dist/loadable-hooks/useSkipLimitPagination.js +11 -9
  64. package/dist/react/FragmentReader.d.ts +7 -14
  65. package/dist/react/FragmentReader.d.ts.map +1 -1
  66. package/dist/react/FragmentReader.js +3 -30
  67. package/dist/react/FragmentRenderer.d.ts +15 -0
  68. package/dist/react/FragmentRenderer.d.ts.map +1 -0
  69. package/dist/react/FragmentRenderer.js +35 -0
  70. package/dist/react/IsographEnvironmentProvider.d.ts.map +1 -1
  71. package/dist/react/LoadableFieldReader.d.ts +12 -0
  72. package/dist/react/LoadableFieldReader.d.ts.map +1 -0
  73. package/dist/react/LoadableFieldReader.js +10 -0
  74. package/dist/react/LoadableFieldRenderer.d.ts +13 -0
  75. package/dist/react/LoadableFieldRenderer.d.ts.map +1 -0
  76. package/dist/react/LoadableFieldRenderer.js +37 -0
  77. package/dist/react/useImperativeReference.d.ts +7 -10
  78. package/dist/react/useImperativeReference.d.ts.map +1 -1
  79. package/dist/react/useImperativeReference.js +8 -9
  80. package/dist/react/useLazyReference.d.ts +4 -7
  81. package/dist/react/useLazyReference.d.ts.map +1 -1
  82. package/dist/react/useLazyReference.js +26 -5
  83. package/dist/react/useReadAndSubscribe.d.ts +3 -9
  84. package/dist/react/useReadAndSubscribe.d.ts.map +1 -1
  85. package/dist/react/useReadAndSubscribe.js +7 -3
  86. package/dist/react/useRerenderOnChange.d.ts +1 -1
  87. package/dist/react/useRerenderOnChange.d.ts.map +1 -1
  88. package/dist/react/useResult.d.ts +3 -6
  89. package/dist/react/useResult.d.ts.map +1 -1
  90. package/dist/react/useResult.js +10 -8
  91. package/isograph.config.json +1 -0
  92. package/package.json +6 -6
  93. package/src/core/FragmentReference.ts +40 -16
  94. package/src/core/IsographEnvironment.ts +57 -39
  95. package/src/core/PromiseWrapper.ts +15 -18
  96. package/src/core/areEqualWithDeepComparison.ts +22 -2
  97. package/src/core/brand.ts +18 -0
  98. package/src/core/cache.ts +153 -113
  99. package/src/core/check.ts +17 -12
  100. package/src/core/componentCache.ts +47 -50
  101. package/src/core/entrypoint.ts +66 -21
  102. package/src/core/garbageCollection.ts +9 -9
  103. package/src/core/logging.ts +39 -25
  104. package/src/core/makeNetworkRequest.ts +212 -34
  105. package/src/core/read.ts +728 -440
  106. package/src/core/reader.ts +46 -29
  107. package/src/core/startUpdate.ts +334 -0
  108. package/src/core/util.ts +4 -0
  109. package/src/index.ts +89 -8
  110. package/src/loadable-hooks/useClientSideDefer.ts +11 -10
  111. package/src/loadable-hooks/useConnectionSpecPagination.ts +27 -13
  112. package/src/loadable-hooks/useImperativeExposedMutationField.ts +1 -1
  113. package/src/loadable-hooks/useImperativeLoadableField.ts +10 -12
  114. package/src/loadable-hooks/useSkipLimitPagination.ts +38 -19
  115. package/src/react/FragmentReader.tsx +23 -39
  116. package/src/react/FragmentRenderer.tsx +46 -0
  117. package/src/react/IsographEnvironmentProvider.tsx +1 -1
  118. package/src/react/LoadableFieldReader.tsx +40 -0
  119. package/src/react/LoadableFieldRenderer.tsx +41 -0
  120. package/src/react/useImperativeReference.ts +49 -27
  121. package/src/react/useLazyReference.ts +62 -14
  122. package/src/react/useReadAndSubscribe.ts +17 -9
  123. package/src/react/useRerenderOnChange.ts +2 -2
  124. package/src/react/useResult.ts +22 -8
  125. package/src/tests/__isograph/Economist/link/output_type.ts +2 -0
  126. package/src/tests/__isograph/Node/asEconomist/resolver_reader.ts +28 -0
  127. package/src/tests/__isograph/Node/link/output_type.ts +3 -0
  128. package/src/tests/__isograph/Query/linkedUpdate/entrypoint.ts +31 -0
  129. package/src/tests/__isograph/Query/linkedUpdate/normalization_ast.ts +95 -0
  130. package/src/tests/__isograph/Query/linkedUpdate/output_type.ts +3 -0
  131. package/src/tests/__isograph/Query/linkedUpdate/param_type.ts +51 -0
  132. package/src/tests/__isograph/Query/linkedUpdate/query_text.ts +20 -0
  133. package/src/tests/__isograph/Query/linkedUpdate/resolver_reader.ts +93 -0
  134. package/src/tests/__isograph/Query/meName/entrypoint.ts +8 -29
  135. package/src/tests/__isograph/Query/meName/normalization_ast.ts +25 -0
  136. package/src/tests/__isograph/Query/meName/query_text.ts +6 -0
  137. package/src/tests/__isograph/Query/meName/resolver_reader.ts +5 -0
  138. package/src/tests/__isograph/Query/meNameSuccessor/entrypoint.ts +8 -67
  139. package/src/tests/__isograph/Query/meNameSuccessor/normalization_ast.ts +56 -0
  140. package/src/tests/__isograph/Query/meNameSuccessor/query_text.ts +13 -0
  141. package/src/tests/__isograph/Query/meNameSuccessor/resolver_reader.ts +10 -0
  142. package/src/tests/__isograph/Query/nodeField/entrypoint.ts +8 -34
  143. package/src/tests/__isograph/Query/nodeField/normalization_ast.ts +30 -0
  144. package/src/tests/__isograph/Query/nodeField/query_text.ts +6 -0
  145. package/src/tests/__isograph/Query/nodeField/resolver_reader.ts +5 -0
  146. package/src/tests/__isograph/Query/startUpdate/entrypoint.ts +31 -0
  147. package/src/tests/__isograph/Query/startUpdate/normalization_ast.ts +51 -0
  148. package/src/tests/__isograph/Query/startUpdate/output_type.ts +3 -0
  149. package/src/tests/__isograph/Query/startUpdate/param_type.ts +26 -0
  150. package/src/tests/__isograph/Query/startUpdate/parameters_type.ts +3 -0
  151. package/src/tests/__isograph/Query/startUpdate/query_text.ts +11 -0
  152. package/src/tests/__isograph/Query/startUpdate/resolver_reader.ts +55 -0
  153. package/src/tests/__isograph/Query/subquery/entrypoint.ts +8 -44
  154. package/src/tests/__isograph/Query/subquery/normalization_ast.ts +38 -0
  155. package/src/tests/__isograph/Query/subquery/query_text.ts +8 -0
  156. package/src/tests/__isograph/Query/subquery/resolver_reader.ts +7 -0
  157. package/src/tests/__isograph/iso.ts +24 -3
  158. package/src/tests/__isograph/tsconfig.json +8 -0
  159. package/src/tests/garbageCollection.test.ts +10 -8
  160. package/src/tests/meNameSuccessor.ts +1 -1
  161. package/src/tests/nodeQuery.ts +2 -1
  162. package/src/tests/normalizeData.test.ts +1 -2
  163. package/src/tests/startUpdate.test.ts +205 -0
  164. package/tsconfig.pkg.json +1 -2
@@ -2,81 +2,22 @@ import type {IsographEntrypoint, NormalizationAst, RefetchQueryNormalizationArti
2
2
  import {Query__meNameSuccessor__param} from './param_type';
3
3
  import {Query__meNameSuccessor__output_type} from './output_type';
4
4
  import readerResolver from './resolver_reader';
5
+ import queryText from './query_text';
6
+ import normalizationAst from './normalization_ast';
5
7
  const nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[] = [];
6
8
 
7
- const queryText = 'query meNameSuccessor {\
8
- me {\
9
- id,\
10
- name,\
11
- successor {\
12
- id,\
13
- successor {\
14
- id,\
15
- name,\
16
- },\
17
- },\
18
- },\
19
- }';
20
-
21
- const normalizationAst: NormalizationAst = [
22
- {
23
- kind: "Linked",
24
- fieldName: "me",
25
- arguments: null,
26
- concreteType: "Economist",
27
- selections: [
28
- {
29
- kind: "Scalar",
30
- fieldName: "id",
31
- arguments: null,
32
- },
33
- {
34
- kind: "Scalar",
35
- fieldName: "name",
36
- arguments: null,
37
- },
38
- {
39
- kind: "Linked",
40
- fieldName: "successor",
41
- arguments: null,
42
- concreteType: "Economist",
43
- selections: [
44
- {
45
- kind: "Scalar",
46
- fieldName: "id",
47
- arguments: null,
48
- },
49
- {
50
- kind: "Linked",
51
- fieldName: "successor",
52
- arguments: null,
53
- concreteType: "Economist",
54
- selections: [
55
- {
56
- kind: "Scalar",
57
- fieldName: "id",
58
- arguments: null,
59
- },
60
- {
61
- kind: "Scalar",
62
- fieldName: "name",
63
- arguments: null,
64
- },
65
- ],
66
- },
67
- ],
68
- },
69
- ],
70
- },
71
- ];
72
9
  const artifact: IsographEntrypoint<
73
10
  Query__meNameSuccessor__param,
74
- Query__meNameSuccessor__output_type
11
+ Query__meNameSuccessor__output_type,
12
+ NormalizationAst
75
13
  > = {
76
14
  kind: "Entrypoint",
77
15
  networkRequestInfo: {
78
16
  kind: "NetworkRequestInfo",
79
- queryText,
17
+ operation: {
18
+ kind: "Operation",
19
+ text: queryText,
20
+ },
80
21
  normalizationAst,
81
22
  },
82
23
  concreteType: "Query",
@@ -0,0 +1,56 @@
1
+ import type {NormalizationAst} from '@isograph/react';
2
+ const normalizationAst: NormalizationAst = {
3
+ kind: "NormalizationAst",
4
+ selections: [
5
+ {
6
+ kind: "Linked",
7
+ fieldName: "me",
8
+ arguments: null,
9
+ concreteType: "Economist",
10
+ selections: [
11
+ {
12
+ kind: "Scalar",
13
+ fieldName: "id",
14
+ arguments: null,
15
+ },
16
+ {
17
+ kind: "Scalar",
18
+ fieldName: "name",
19
+ arguments: null,
20
+ },
21
+ {
22
+ kind: "Linked",
23
+ fieldName: "successor",
24
+ arguments: null,
25
+ concreteType: "Economist",
26
+ selections: [
27
+ {
28
+ kind: "Scalar",
29
+ fieldName: "id",
30
+ arguments: null,
31
+ },
32
+ {
33
+ kind: "Linked",
34
+ fieldName: "successor",
35
+ arguments: null,
36
+ concreteType: "Economist",
37
+ selections: [
38
+ {
39
+ kind: "Scalar",
40
+ fieldName: "id",
41
+ arguments: null,
42
+ },
43
+ {
44
+ kind: "Scalar",
45
+ fieldName: "name",
46
+ arguments: null,
47
+ },
48
+ ],
49
+ },
50
+ ],
51
+ },
52
+ ],
53
+ },
54
+ ],
55
+ };
56
+ export default normalizationAst;
@@ -0,0 +1,13 @@
1
+ export default 'query meNameSuccessor {\
2
+ me {\
3
+ id,\
4
+ name,\
5
+ successor {\
6
+ id,\
7
+ successor {\
8
+ id,\
9
+ name,\
10
+ },\
11
+ },\
12
+ },\
13
+ }';
@@ -10,12 +10,14 @@ const readerAst: ReaderAst<Query__meNameSuccessor__param> = [
10
10
  alias: null,
11
11
  arguments: null,
12
12
  condition: null,
13
+ isUpdatable: false,
13
14
  selections: [
14
15
  {
15
16
  kind: "Scalar",
16
17
  fieldName: "name",
17
18
  alias: null,
18
19
  arguments: null,
20
+ isUpdatable: false,
19
21
  },
20
22
  {
21
23
  kind: "Linked",
@@ -23,6 +25,7 @@ const readerAst: ReaderAst<Query__meNameSuccessor__param> = [
23
25
  alias: null,
24
26
  arguments: null,
25
27
  condition: null,
28
+ isUpdatable: false,
26
29
  selections: [
27
30
  {
28
31
  kind: "Linked",
@@ -30,18 +33,23 @@ const readerAst: ReaderAst<Query__meNameSuccessor__param> = [
30
33
  alias: null,
31
34
  arguments: null,
32
35
  condition: null,
36
+ isUpdatable: false,
33
37
  selections: [
34
38
  {
35
39
  kind: "Scalar",
36
40
  fieldName: "name",
37
41
  alias: null,
38
42
  arguments: null,
43
+ isUpdatable: false,
39
44
  },
40
45
  ],
46
+ refetchQueryIndex: null,
41
47
  },
42
48
  ],
49
+ refetchQueryIndex: null,
43
50
  },
44
51
  ],
52
+ refetchQueryIndex: null,
45
53
  },
46
54
  ];
47
55
 
@@ -50,8 +58,10 @@ const artifact: EagerReaderArtifact<
50
58
  Query__meNameSuccessor__output_type
51
59
  > = {
52
60
  kind: "EagerReaderArtifact",
61
+ fieldName: "Query.meNameSuccessor",
53
62
  resolver,
54
63
  readerAst,
64
+ hasUpdatable: false,
55
65
  };
56
66
 
57
67
  export default artifact;
@@ -2,48 +2,22 @@ import type {IsographEntrypoint, NormalizationAst, RefetchQueryNormalizationArti
2
2
  import {Query__nodeField__param} from './param_type';
3
3
  import {Query__nodeField__output_type} from './output_type';
4
4
  import readerResolver from './resolver_reader';
5
+ import queryText from './query_text';
6
+ import normalizationAst from './normalization_ast';
5
7
  const nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[] = [];
6
8
 
7
- const queryText = 'query nodeField ($id: ID!) {\
8
- node____id___v_id: node(id: $id) {\
9
- __typename,\
10
- id,\
11
- },\
12
- }';
13
-
14
- const normalizationAst: NormalizationAst = [
15
- {
16
- kind: "Linked",
17
- fieldName: "node",
18
- arguments: [
19
- [
20
- "id",
21
- { kind: "Variable", name: "id" },
22
- ],
23
- ],
24
- concreteType: null,
25
- selections: [
26
- {
27
- kind: "Scalar",
28
- fieldName: "__typename",
29
- arguments: null,
30
- },
31
- {
32
- kind: "Scalar",
33
- fieldName: "id",
34
- arguments: null,
35
- },
36
- ],
37
- },
38
- ];
39
9
  const artifact: IsographEntrypoint<
40
10
  Query__nodeField__param,
41
- Query__nodeField__output_type
11
+ Query__nodeField__output_type,
12
+ NormalizationAst
42
13
  > = {
43
14
  kind: "Entrypoint",
44
15
  networkRequestInfo: {
45
16
  kind: "NetworkRequestInfo",
46
- queryText,
17
+ operation: {
18
+ kind: "Operation",
19
+ text: queryText,
20
+ },
47
21
  normalizationAst,
48
22
  },
49
23
  concreteType: "Query",
@@ -0,0 +1,30 @@
1
+ import type {NormalizationAst} from '@isograph/react';
2
+ const normalizationAst: NormalizationAst = {
3
+ kind: "NormalizationAst",
4
+ selections: [
5
+ {
6
+ kind: "Linked",
7
+ fieldName: "node",
8
+ arguments: [
9
+ [
10
+ "id",
11
+ { kind: "Variable", name: "id" },
12
+ ],
13
+ ],
14
+ concreteType: null,
15
+ selections: [
16
+ {
17
+ kind: "Scalar",
18
+ fieldName: "__typename",
19
+ arguments: null,
20
+ },
21
+ {
22
+ kind: "Scalar",
23
+ fieldName: "id",
24
+ arguments: null,
25
+ },
26
+ ],
27
+ },
28
+ ],
29
+ };
30
+ export default normalizationAst;
@@ -0,0 +1,6 @@
1
+ export default 'query nodeField($id: ID!) {\
2
+ node____id___v_id: node(id: $id) {\
3
+ __typename,\
4
+ id,\
5
+ },\
6
+ }';
@@ -15,14 +15,17 @@ const readerAst: ReaderAst<Query__nodeField__param> = [
15
15
  ],
16
16
  ],
17
17
  condition: null,
18
+ isUpdatable: false,
18
19
  selections: [
19
20
  {
20
21
  kind: "Scalar",
21
22
  fieldName: "id",
22
23
  alias: null,
23
24
  arguments: null,
25
+ isUpdatable: false,
24
26
  },
25
27
  ],
28
+ refetchQueryIndex: null,
26
29
  },
27
30
  ];
28
31
 
@@ -31,8 +34,10 @@ const artifact: EagerReaderArtifact<
31
34
  Query__nodeField__output_type
32
35
  > = {
33
36
  kind: "EagerReaderArtifact",
37
+ fieldName: "Query.nodeField",
34
38
  resolver,
35
39
  readerAst,
40
+ hasUpdatable: false,
36
41
  };
37
42
 
38
43
  export default artifact;
@@ -0,0 +1,31 @@
1
+ import type {IsographEntrypoint, NormalizationAst, RefetchQueryNormalizationArtifactWrapper} from '@isograph/react';
2
+ import {Query__startUpdate__param} from './param_type';
3
+ import {Query__startUpdate__output_type} from './output_type';
4
+ import readerResolver from './resolver_reader';
5
+ import queryText from './query_text';
6
+ import normalizationAst from './normalization_ast';
7
+ const nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[] = [];
8
+
9
+ const artifact: IsographEntrypoint<
10
+ Query__startUpdate__param,
11
+ Query__startUpdate__output_type,
12
+ NormalizationAst
13
+ > = {
14
+ kind: "Entrypoint",
15
+ networkRequestInfo: {
16
+ kind: "NetworkRequestInfo",
17
+ operation: {
18
+ kind: "Operation",
19
+ text: queryText,
20
+ },
21
+ normalizationAst,
22
+ },
23
+ concreteType: "Query",
24
+ readerWithRefetchQueries: {
25
+ kind: "ReaderWithRefetchQueries",
26
+ nestedRefetchQueries,
27
+ readerArtifact: readerResolver,
28
+ },
29
+ };
30
+
31
+ export default artifact;
@@ -0,0 +1,51 @@
1
+ import type {NormalizationAst} from '@isograph/react';
2
+ const normalizationAst: NormalizationAst = {
3
+ kind: "NormalizationAst",
4
+ selections: [
5
+ {
6
+ kind: "Linked",
7
+ fieldName: "node",
8
+ arguments: [
9
+ [
10
+ "id",
11
+ { kind: "Variable", name: "id" },
12
+ ],
13
+ ],
14
+ concreteType: null,
15
+ selections: [
16
+ {
17
+ kind: "Scalar",
18
+ fieldName: "__typename",
19
+ arguments: null,
20
+ },
21
+ {
22
+ kind: "Scalar",
23
+ fieldName: "id",
24
+ arguments: null,
25
+ },
26
+ {
27
+ kind: "InlineFragment",
28
+ type: "Economist",
29
+ selections: [
30
+ {
31
+ kind: "Scalar",
32
+ fieldName: "__typename",
33
+ arguments: null,
34
+ },
35
+ {
36
+ kind: "Scalar",
37
+ fieldName: "id",
38
+ arguments: null,
39
+ },
40
+ {
41
+ kind: "Scalar",
42
+ fieldName: "name",
43
+ arguments: null,
44
+ },
45
+ ],
46
+ },
47
+ ],
48
+ },
49
+ ],
50
+ };
51
+ export default normalizationAst;
@@ -0,0 +1,3 @@
1
+ import type React from 'react';
2
+ import { startUpdate as resolver } from '../../../startUpdate.test';
3
+ export type Query__startUpdate__output_type = ReturnType<typeof resolver>;
@@ -0,0 +1,26 @@
1
+ import type { StartUpdate } from '@isograph/react';
2
+ import type { Query__startUpdate__parameters } from './parameters_type';
3
+
4
+ export type Query__startUpdate__param = {
5
+ readonly data: {
6
+ readonly node: ({
7
+ /**
8
+ A client pointer for the Economist type.
9
+ */
10
+ readonly asEconomist: ({
11
+ readonly name: string,
12
+ } | null),
13
+ } | null),
14
+ },
15
+ readonly parameters: Query__startUpdate__parameters,
16
+ readonly startUpdate: StartUpdate<{
17
+ readonly node: ({
18
+ /**
19
+ A client pointer for the Economist type.
20
+ */
21
+ readonly asEconomist: ({
22
+ name: string,
23
+ } | null),
24
+ } | null),
25
+ }>,
26
+ };
@@ -0,0 +1,3 @@
1
+ export type Query__startUpdate__parameters = {
2
+ readonly id: string,
3
+ };
@@ -0,0 +1,11 @@
1
+ export default 'query startUpdate($id: ID!) {\
2
+ node____id___v_id: node(id: $id) {\
3
+ __typename,\
4
+ id,\
5
+ ... on Economist {\
6
+ __typename,\
7
+ id,\
8
+ name,\
9
+ },\
10
+ },\
11
+ }';
@@ -0,0 +1,55 @@
1
+ import type { EagerReaderArtifact, ReaderAst } from '@isograph/react';
2
+ import { Query__startUpdate__param } from './param_type';
3
+ import { Query__startUpdate__output_type } from './output_type';
4
+ import { startUpdate as resolver } from '../../../startUpdate.test';
5
+ import Node__asEconomist__resolver_reader from '../../Node/asEconomist/resolver_reader';
6
+
7
+ const readerAst: ReaderAst<Query__startUpdate__param> = [
8
+ {
9
+ kind: "Linked",
10
+ fieldName: "node",
11
+ alias: null,
12
+ arguments: [
13
+ [
14
+ "id",
15
+ { kind: "Variable", name: "id" },
16
+ ],
17
+ ],
18
+ condition: null,
19
+ isUpdatable: false,
20
+ selections: [
21
+ {
22
+ kind: "Linked",
23
+ fieldName: "asEconomist",
24
+ alias: null,
25
+ arguments: null,
26
+ condition: Node__asEconomist__resolver_reader,
27
+ isUpdatable: false,
28
+ selections: [
29
+ {
30
+ kind: "Scalar",
31
+ fieldName: "name",
32
+ alias: null,
33
+ arguments: null,
34
+ isUpdatable: true,
35
+ },
36
+ ],
37
+ refetchQueryIndex: null,
38
+ },
39
+ ],
40
+ refetchQueryIndex: null,
41
+ },
42
+ ];
43
+
44
+ const artifact: EagerReaderArtifact<
45
+ Query__startUpdate__param,
46
+ Query__startUpdate__output_type
47
+ > = {
48
+ kind: "EagerReaderArtifact",
49
+ fieldName: "Query.startUpdate",
50
+ resolver,
51
+ readerAst,
52
+ hasUpdatable: true,
53
+ };
54
+
55
+ export default artifact;
@@ -2,58 +2,22 @@ import type {IsographEntrypoint, NormalizationAst, RefetchQueryNormalizationArti
2
2
  import {Query__subquery__param} from './param_type';
3
3
  import {Query__subquery__output_type} from './output_type';
4
4
  import readerResolver from './resolver_reader';
5
+ import queryText from './query_text';
6
+ import normalizationAst from './normalization_ast';
5
7
  const nestedRefetchQueries: RefetchQueryNormalizationArtifactWrapper[] = [];
6
8
 
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
9
  const artifact: IsographEntrypoint<
50
10
  Query__subquery__param,
51
- Query__subquery__output_type
11
+ Query__subquery__output_type,
12
+ NormalizationAst
52
13
  > = {
53
14
  kind: "Entrypoint",
54
15
  networkRequestInfo: {
55
16
  kind: "NetworkRequestInfo",
56
- queryText,
17
+ operation: {
18
+ kind: "Operation",
19
+ text: queryText,
20
+ },
57
21
  normalizationAst,
58
22
  },
59
23
  concreteType: "Query",
@@ -0,0 +1,38 @@
1
+ import type {NormalizationAst} from '@isograph/react';
2
+ const normalizationAst: NormalizationAst = {
3
+ kind: "NormalizationAst",
4
+ selections: [
5
+ {
6
+ kind: "Linked",
7
+ fieldName: "query",
8
+ arguments: null,
9
+ concreteType: "Query",
10
+ selections: [
11
+ {
12
+ kind: "Linked",
13
+ fieldName: "node",
14
+ arguments: [
15
+ [
16
+ "id",
17
+ { kind: "Variable", name: "id" },
18
+ ],
19
+ ],
20
+ concreteType: null,
21
+ selections: [
22
+ {
23
+ kind: "Scalar",
24
+ fieldName: "__typename",
25
+ arguments: null,
26
+ },
27
+ {
28
+ kind: "Scalar",
29
+ fieldName: "id",
30
+ arguments: null,
31
+ },
32
+ ],
33
+ },
34
+ ],
35
+ },
36
+ ],
37
+ };
38
+ export default normalizationAst;
@@ -0,0 +1,8 @@
1
+ export default 'query subquery($id: ID!) {\
2
+ query {\
3
+ node____id___v_id: node(id: $id) {\
4
+ __typename,\
5
+ id,\
6
+ },\
7
+ },\
8
+ }';
@@ -10,6 +10,7 @@ const readerAst: ReaderAst<Query__subquery__param> = [
10
10
  alias: null,
11
11
  arguments: null,
12
12
  condition: null,
13
+ isUpdatable: false,
13
14
  selections: [
14
15
  {
15
16
  kind: "Linked",
@@ -22,16 +23,20 @@ const readerAst: ReaderAst<Query__subquery__param> = [
22
23
  ],
23
24
  ],
24
25
  condition: null,
26
+ isUpdatable: false,
25
27
  selections: [
26
28
  {
27
29
  kind: "Scalar",
28
30
  fieldName: "id",
29
31
  alias: null,
30
32
  arguments: null,
33
+ isUpdatable: false,
31
34
  },
32
35
  ],
36
+ refetchQueryIndex: null,
33
37
  },
34
38
  ],
39
+ refetchQueryIndex: null,
35
40
  },
36
41
  ];
37
42
 
@@ -40,8 +45,10 @@ const artifact: EagerReaderArtifact<
40
45
  Query__subquery__output_type
41
46
  > = {
42
47
  kind: "EagerReaderArtifact",
48
+ fieldName: "Query.subquery",
43
49
  resolver,
44
50
  readerAst,
51
+ hasUpdatable: false,
45
52
  };
46
53
 
47
54
  export default artifact;