Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test format #2

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/prereleasePublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/checkout@v4
with:
node-version: "12"
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Publish to npm @dev
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/releasePublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/checkout@v4
with:
node-version: "12"
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Publish to npm @latest
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/checkout@v4
with:
node-version: "12"
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
- run: npm install

- run: npm install --legacy-peer-deps

- run: npm run format:ci

- run: npm run build
3 changes: 2 additions & 1 deletion 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 All @@ -24,7 +25,7 @@
"@reasonml-community/graphql-ppx": "^1.0.0",
"@rescript/react": "~0.11.0",
"rescript": "~10.1.2",
"graphql": "^14.0.0",
"graphql": "^15.0.0",
"jest": "26.5.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
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