Skip to content

Commit 457d965

Browse files
authored
Merge pull request #155 from illusionalsagacity/rescript-format
Formats the source code
2 parents f13c180 + 521570a commit 457d965

20 files changed

+407
-401
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-node@v2-beta
1818
with:
19-
node-version: "12"
19+
node-version: "18"
2020
registry-url: "https://registry.npmjs.org"
2121
- run: npm install
22+
- run: npm run format:ci
2223
- run: npm run build

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
"scripts": {
1717
"build": "rescript build -with-deps",
1818
"clean": "rescript clean",
19+
"format:ci": "rescript format -check -all",
1920
"start": "rescript build -with-deps -w",
2021
"test": "jest"
2122
},
2223
"devDependencies": {
2324
"@apollo/client": "^3.5.0",
24-
"@reasonml-community/graphql-ppx": "^1.0.0",
25+
"@reasonml-community/graphql-ppx": "1.2.4-1345e061.0",
2526
"@rescript/react": "~0.11.0",
2627
"rescript": "~10.1.2",
27-
"graphql": "^14.0.0",
28+
"graphql": "^15.0.0",
2829
"jest": "26.5.3",
2930
"react": "^18.2.0",
3031
"react-dom": "^18.2.0",

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

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ module ApolloCache = {
186186
js
187187
->Js_.readFragment(
188188
~options={
189-
id: id,
189+
id,
190190
fragment: Fragment.query,
191-
fragmentName: fragmentName,
192-
optimistic: optimistic,
193-
canonizeResults: 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: id,
221+
id,
222222
query: Operation.query,
223-
variables: variables,
224-
optimistic: optimistic,
225-
canonizeResults: canonizeResults,
223+
variables,
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: broadcast,
251-
data: data,
252-
id: id,
250+
broadcast,
251+
data,
252+
id,
253253
fragment: Fragment.query,
254-
fragmentName: fragmentName,
255-
overwrite: 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: broadcast,
279-
data: data,
280-
id: id,
278+
broadcast,
279+
data,
280+
id,
281281
query: Operation.query,
282-
variables: variables,
283-
overwrite: overwrite,
282+
variables,
283+
overwrite,
284284
},
285285
~mapJsVariables,
286286
~serialize=Operation.serialize,
@@ -307,25 +307,27 @@ module ApolloCache = {
307307
let safeParse = Utils.safeParse(Operation.parse)
308308

309309
js
310-
->Js_.updateQuery(~options=DataProxy.UpdateQueryOptions.toJs(
311-
{
312-
optimistic: optimistic,
313-
canonizeResults: canonizeResults,
314-
broadcast: broadcast,
315-
id: id,
316-
query: Operation.query,
317-
variables: variables,
318-
overwrite: overwrite,
319-
},
320-
~mapJsVariables,
321-
~serializeVariables=Operation.serializeVariables,
322-
), ~update=jsData =>
323-
jsData
324-
->Js.nullToOption
325-
->Belt.Option.map(Operation.parse)
326-
->update
327-
->Belt.Option.map(Operation.serialize)
328-
->Js.Nullable.fromOption
310+
->Js_.updateQuery(
311+
~options=DataProxy.UpdateQueryOptions.toJs(
312+
{
313+
optimistic,
314+
canonizeResults,
315+
broadcast,
316+
id,
317+
query: Operation.query,
318+
variables,
319+
overwrite,
320+
},
321+
~mapJsVariables,
322+
~serializeVariables=Operation.serializeVariables,
323+
),
324+
~update=jsData =>
325+
jsData
326+
->Js.nullToOption
327+
->Belt.Option.map(Operation.parse)
328+
->update
329+
->Belt.Option.map(Operation.serialize)
330+
->Js.Nullable.fromOption,
329331
)
330332
->Js.toOption
331333
->Belt.Option.map(safeParse)
@@ -346,21 +348,23 @@ module ApolloCache = {
346348
let safeParse = Utils.safeParse(Fragment.parse)
347349

348350
js
349-
->Js_.updateFragment(~options=DataProxy.UpdateFragmentOptions.toJs({
350-
optimistic: optimistic,
351-
canonizeResults: canonizeResults,
352-
broadcast: broadcast,
353-
id: id,
354-
fragment: Fragment.query,
355-
fragmentName: fragmentName,
356-
overwrite: overwrite,
357-
}), ~update=jsData =>
358-
jsData
359-
->Js.nullToOption
360-
->Belt.Option.map(Fragment.parse)
361-
->update
362-
->Belt.Option.map(Fragment.serialize)
363-
->Js.Nullable.fromOption
351+
->Js_.updateFragment(
352+
~options=DataProxy.UpdateFragmentOptions.toJs({
353+
optimistic,
354+
canonizeResults,
355+
broadcast,
356+
id,
357+
fragment: Fragment.query,
358+
fragmentName,
359+
overwrite,
360+
}),
361+
~update=jsData =>
362+
jsData
363+
->Js.nullToOption
364+
->Belt.Option.map(Fragment.parse)
365+
->update
366+
->Belt.Option.map(Fragment.serialize)
367+
->Js.Nullable.fromOption,
364368
)
365369
->Js.toOption
366370
->Belt.Option.map(safeParse)
@@ -369,12 +373,12 @@ module ApolloCache = {
369373
preserveJsPropsAndContext(
370374
js,
371375
{
372-
readFragment: readFragment,
373-
readQuery: readQuery,
374-
writeFragment: writeFragment,
375-
writeQuery: writeQuery,
376-
updateFragment: updateFragment,
377-
updateQuery: updateQuery,
376+
readFragment,
377+
readQuery,
378+
writeFragment,
379+
writeQuery,
380+
updateFragment,
381+
updateQuery,
378382
},
379383
)
380384
}

src/@apollo/client/cache/inmemory/ApolloClient__Cache_InMemory_Policies.res

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ module TypePolicy = {
126126
~subscriptionType: bool=?,
127127
unit,
128128
) => t = (~fields=?, ~keyFields=?, ~mutationType=?, ~queryType=?, ~subscriptionType=?, ()) => {
129-
fields: fields,
130-
keyFields: keyFields,
131-
mutationType: mutationType,
132-
queryType: queryType,
133-
subscriptionType: subscriptionType,
129+
fields,
130+
keyFields,
131+
mutationType,
132+
queryType,
133+
subscriptionType,
134134
}
135135
}
136136

0 commit comments

Comments
 (0)