Skip to content

Commit 611f6d0

Browse files
authored
Merge pull request #154 from illusionalsagacity/optional-records
BREAKING: convert @obj and @deriving(abstract) to use optional record fields
2 parents bdff923 + ddd0e7f commit 611f6d0

29 files changed

+867
-928
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*.re linguist-language=Reason
22
*.rei linguist-language=Reason
3+
*.res linguist-language=ReScript
4+
*.resi linguist-language=ReScript

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ yarn-error.log
88
.vscode/
99
lib/
1010
node_modules/
11+
.yarn/install-state.gz

EXAMPLES/bsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
"version": 4,
2121
"mode": "automatic"
2222
},
23-
"reason": {
24-
"react-jsx": 3
25-
},
26-
"refmt": 3,
2723
"sources": [
2824
{
2925
"dir": "src",

EXAMPLES/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"start": "rescript build -with-deps -w"
1212
},
1313
"devDependencies": {
14-
"@reasonml-community/graphql-ppx": "1.2.3",
14+
"@reasonml-community/graphql-ppx": "1.2.4-1345e061.0",
1515
"graphql-client-example-server": "1.5.2",
1616
"html-webpack-plugin": "5.5.0",
1717
"rescript": "10.1.2",

bsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
"in-source": true
77
}
88
],
9-
"reason": {
10-
"react-jsx": 3
11-
},
12-
"refmt": 3,
139
"jsx": {
1410
"version": 4,
1511
"mode": "automatic"

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@
3535
"@apollo/client": "^3.5.0",
3636
"@reasonml-community/graphql-ppx": "^1.0.0",
3737
"@rescript/react": "~0.10. || ~0.11.0",
38-
"bs-platform": "^8.2.0 || ^9.0.0",
39-
"rescript": "^9.0.0 || ^10.0.0"
38+
"rescript": "^10.0.0"
4039
},
4140
"peerDependenciesMeta": {
4241
"rescript": {
4342
"optional": true
44-
},
45-
"bs-platform": {
46-
"optional": true
4743
}
4844
},
4945
"workspaces": [

src/@apollo/client/cache/core/ApolloClient__Cache_Core_Cache.res

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ module ApolloCache = {
188188
~options={
189189
id,
190190
fragment: Fragment.query,
191-
fragmentName,
192-
optimistic,
193-
canonizeResults,
191+
?fragmentName,
192+
?optimistic,
193+
?canonizeResults,
194194
},
195195
~optimistic?,
196196
(),
@@ -218,11 +218,11 @@ module ApolloCache = {
218218
->Js_.readQuery(
219219
~options=DataProxy.ReadQueryOptions.toJs(
220220
{
221-
id,
221+
?id,
222222
query: Operation.query,
223223
variables,
224-
optimistic,
225-
canonizeResults,
224+
?optimistic,
225+
?canonizeResults,
226226
},
227227
~mapJsVariables,
228228
~serializeVariables=Operation.serializeVariables,
@@ -247,12 +247,12 @@ module ApolloCache = {
247247
js->Js_.writeFragment(
248248
~options=DataProxy.WriteFragmentOptions.toJs(
249249
{
250-
broadcast,
250+
?broadcast,
251251
data,
252252
id,
253253
fragment: Fragment.query,
254-
fragmentName,
255-
overwrite,
254+
?fragmentName,
255+
?overwrite,
256256
},
257257
~serialize=Fragment.serialize,
258258
),
@@ -275,12 +275,12 @@ module ApolloCache = {
275275
js->Js_.writeQuery(
276276
~options=DataProxy.WriteQueryOptions.toJs(
277277
{
278-
broadcast,
278+
?broadcast,
279279
data,
280-
id,
280+
?id,
281281
query: Operation.query,
282282
variables,
283-
overwrite,
283+
?overwrite,
284284
},
285285
~mapJsVariables,
286286
~serialize=Operation.serialize,
@@ -310,13 +310,13 @@ module ApolloCache = {
310310
->Js_.updateQuery(
311311
~options=DataProxy.UpdateQueryOptions.toJs(
312312
{
313-
optimistic,
314-
canonizeResults,
315-
broadcast,
316-
id,
313+
?optimistic,
314+
?canonizeResults,
315+
?broadcast,
316+
?id,
317317
query: Operation.query,
318318
variables,
319-
overwrite,
319+
?overwrite,
320320
},
321321
~mapJsVariables,
322322
~serializeVariables=Operation.serializeVariables,
@@ -350,13 +350,13 @@ module ApolloCache = {
350350
js
351351
->Js_.updateFragment(
352352
~options=DataProxy.UpdateFragmentOptions.toJs({
353-
optimistic,
354-
canonizeResults,
355-
broadcast,
353+
?optimistic,
354+
?canonizeResults,
355+
?broadcast,
356356
id,
357357
fragment: Fragment.query,
358-
fragmentName,
359-
overwrite,
358+
?fragmentName,
359+
?overwrite,
360360
}),
361361
~update=jsData =>
362362
jsData

0 commit comments

Comments
 (0)