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

fix: EXAMPLES wasn't working #158

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions EXAMPLES/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Examples for rescript-apollo-client",
"private": true,
"scripts": {
"build": "rescript build -with-deps",
"clean": "rescript clean",
"graphql-server": "graphql-client-example-server",
"server": "webpack-dev-server",
Expand All @@ -20,12 +21,11 @@
},
"dependencies": {
"@apollo/client": "3.7.6",
"@rescript/react": "0.11.0",
"@rescript/react": "~0.11.0",
"@ryyppy/rescript-promise": "2.1.0",
"graphql": "^15.7.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"reason-promise": "1.1.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"rescript-apollo-client": "3.2.0",
"subscriptions-transport-ws": "0.11.0"
}
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLES/src/Apollo.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let graphqlEndpoint = "localhost:4000"
let graphqlEndpoint = "localhost:4000/graphql"

let headers = {"high": "five"}

Expand Down
8 changes: 7 additions & 1 deletion EXAMPLES/src/WebpackEntry.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
switch ReactDOM.querySelector("#root") {
| Some(el) => ReactDOM.Client.createRoot(el)->ReactDOM.Client.Root.render(<App />)
| Some(el) =>
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
el,
)
| None => ()
}
2 changes: 1 addition & 1 deletion EXAMPLES/src/clientUsage/ClientBasics.res
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ let statsSubscription = Apollo.client.subscribe(
let make = () =>
<div>
<p>
<button onClick=logTodos> {"Log To-Dos (Reason Promise)"->React.string} </button>
<button onClick=logTodos> {"Log To-Dos"->React.string} </button>
</p>
<p>
<button onClick=addTodo> {"Add To-Do"->React.string} </button>
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"@apollo/client": "^3.5.0",
"@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",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rescript": "~10.1.2",
"subscriptions-transport-ws": "^0.9.17"
},
"peerDependencies": {
Expand All @@ -44,5 +44,9 @@
"bs-platform": {
"optional": true
}
}
},
"workspaces": [
"EXAMPLES",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change automatically links the version of rescript-apollo-client into the EXAMPLES workspace, so that you can use the local repository version instead of relying on a version to be published

"./"
]
}
Loading