Skip to content

Commit

Permalink
run: rescript format -all
Browse files Browse the repository at this point in the history
  • Loading branch information
illusionalsagacity committed Feb 6, 2024
1 parent f13c180 commit 9b9427e
Show file tree
Hide file tree
Showing 20 changed files with 405 additions and 399 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: "12"
node-version: "18"
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm run format:ci
- run: npm run build
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"scripts": {
"build": "rescript build -with-deps",
"clean": "rescript clean",
"format:ci": "rescript format -check -all",
"start": "rescript build -with-deps -w",
"test": "jest"
},
Expand Down
120 changes: 62 additions & 58 deletions src/@apollo/client/cache/core/ApolloClient__Cache_Core_Cache.res
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ module ApolloCache = {
js
->Js_.readFragment(
~options={
id: id,
id,
fragment: Fragment.query,
fragmentName: fragmentName,
optimistic: optimistic,
canonizeResults: canonizeResults,
fragmentName,
optimistic,
canonizeResults,
},
~optimistic?,
(),
Expand Down Expand Up @@ -218,11 +218,11 @@ module ApolloCache = {
->Js_.readQuery(
~options=DataProxy.ReadQueryOptions.toJs(
{
id: id,
id,
query: Operation.query,
variables: variables,
optimistic: optimistic,
canonizeResults: canonizeResults,
variables,
optimistic,
canonizeResults,
},
~mapJsVariables,
~serializeVariables=Operation.serializeVariables,
Expand All @@ -247,12 +247,12 @@ module ApolloCache = {
js->Js_.writeFragment(
~options=DataProxy.WriteFragmentOptions.toJs(
{
broadcast: broadcast,
data: data,
id: id,
broadcast,
data,
id,
fragment: Fragment.query,
fragmentName: fragmentName,
overwrite: overwrite,
fragmentName,
overwrite,
},
~serialize=Fragment.serialize,
),
Expand All @@ -275,12 +275,12 @@ module ApolloCache = {
js->Js_.writeQuery(
~options=DataProxy.WriteQueryOptions.toJs(
{
broadcast: broadcast,
data: data,
id: id,
broadcast,
data,
id,
query: Operation.query,
variables: variables,
overwrite: overwrite,
variables,
overwrite,
},
~mapJsVariables,
~serialize=Operation.serialize,
Expand All @@ -307,25 +307,27 @@ module ApolloCache = {
let safeParse = Utils.safeParse(Operation.parse)

js
->Js_.updateQuery(~options=DataProxy.UpdateQueryOptions.toJs(
{
optimistic: optimistic,
canonizeResults: canonizeResults,
broadcast: broadcast,
id: id,
query: Operation.query,
variables: variables,
overwrite: overwrite,
},
~mapJsVariables,
~serializeVariables=Operation.serializeVariables,
), ~update=jsData =>
jsData
->Js.nullToOption
->Belt.Option.map(Operation.parse)
->update
->Belt.Option.map(Operation.serialize)
->Js.Nullable.fromOption
->Js_.updateQuery(
~options=DataProxy.UpdateQueryOptions.toJs(
{
optimistic,
canonizeResults,
broadcast,
id,
query: Operation.query,
variables,
overwrite,
},
~mapJsVariables,
~serializeVariables=Operation.serializeVariables,
),
~update=jsData =>
jsData
->Js.nullToOption
->Belt.Option.map(Operation.parse)
->update
->Belt.Option.map(Operation.serialize)
->Js.Nullable.fromOption,
)
->Js.toOption
->Belt.Option.map(safeParse)
Expand All @@ -346,21 +348,23 @@ module ApolloCache = {
let safeParse = Utils.safeParse(Fragment.parse)

js
->Js_.updateFragment(~options=DataProxy.UpdateFragmentOptions.toJs({
optimistic: optimistic,
canonizeResults: canonizeResults,
broadcast: broadcast,
id: id,
fragment: Fragment.query,
fragmentName: fragmentName,
overwrite: overwrite,
}), ~update=jsData =>
jsData
->Js.nullToOption
->Belt.Option.map(Fragment.parse)
->update
->Belt.Option.map(Fragment.serialize)
->Js.Nullable.fromOption
->Js_.updateFragment(
~options=DataProxy.UpdateFragmentOptions.toJs({
optimistic,
canonizeResults,
broadcast,
id,
fragment: Fragment.query,
fragmentName,
overwrite,
}),
~update=jsData =>
jsData
->Js.nullToOption
->Belt.Option.map(Fragment.parse)
->update
->Belt.Option.map(Fragment.serialize)
->Js.Nullable.fromOption,
)
->Js.toOption
->Belt.Option.map(safeParse)
Expand All @@ -369,12 +373,12 @@ module ApolloCache = {
preserveJsPropsAndContext(
js,
{
readFragment: readFragment,
readQuery: readQuery,
writeFragment: writeFragment,
writeQuery: writeQuery,
updateFragment: updateFragment,
updateQuery: updateQuery,
readFragment,
readQuery,
writeFragment,
writeQuery,
updateFragment,
updateQuery,
},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ module TypePolicy = {
~subscriptionType: bool=?,
unit,
) => t = (~fields=?, ~keyFields=?, ~mutationType=?, ~queryType=?, ~subscriptionType=?, ()) => {
fields: fields,
keyFields: keyFields,
mutationType: mutationType,
queryType: queryType,
subscriptionType: subscriptionType,
fields,
keyFields,
mutationType,
queryType,
subscriptionType,
}
}

Expand Down
Loading

0 comments on commit 9b9427e

Please sign in to comment.