Skip to content

Commit b751ad1

Browse files
Update examples to point at new Netlify serverless function for formidadog-ql. (#197)
1 parent 8204639 commit b751ad1

File tree

6 files changed

+13
-28
lines changed

6 files changed

+13
-28
lines changed

docs/exchanges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ let debugExchange = (Exchanges.{forward}) =>
193193
194194
let client =
195195
Client.make(
196-
~url="https://formidadog-ql.now.sh",
196+
~url="https://my-graphql-endpoint.com/graphql",
197197
~exchanges=[|
198198
debugExchange,
199199
Exchanges.dedupExchange,

examples/1-execute-query-mutation/src/App.re

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ let make = () => {
1010
~padding="20px",
1111
(),
1212
)}>
13-
<ColdStart />
1413
<Previewer />
1514
</div>;
1615
};

examples/1-execute-query-mutation/src/ColdStart.re

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/1-execute-query-mutation/src/Previewer.re

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
open ReasonUrql;
22

3-
let client = Client.make(~url="https://formidadog-ql.now.sh", ());
3+
let client =
4+
Client.make(~url="https://formidadog-ql.netlify.app/graphql", ());
45

56
module GetAllDogs = [%graphql
67
{|
@@ -58,29 +59,25 @@ let make = () => {
5859
);
5960

6061
let executeQuery = () => {
61-
Client.query(
62+
Client.executeQuery(
6263
~client,
6364
~request=queryRequest,
6465
~requestPolicy=`CacheAndNetwork,
6566
(),
6667
)
67-
|> Js.Promise.then_(data =>
68+
|> Wonka.subscribe((. data) =>
6869
switch (Client.(data.response)) {
6970
| Data(d) =>
7071
switch (Js.Json.stringifyAny(d)) {
71-
| Some(s) =>
72-
dispatch(SetQuery(s));
73-
Js.Promise.resolve();
74-
| None => Js.Promise.resolve()
72+
| Some(s) => dispatch(SetQuery(s))
73+
| None => ()
7574
}
7675
| Error(e) =>
7776
switch (Js.Json.stringifyAny(e)) {
78-
| Some(s) =>
79-
dispatch(SetQuery(s));
80-
Js.Promise.resolve();
81-
| None => Js.Promise.resolve()
77+
| Some(s) => dispatch(SetQuery(s))
78+
| None => ()
8279
}
83-
| _ => Js.Promise.resolve()
80+
| _ => ()
8481
}
8582
);
8683
};

examples/3-mutation/src/index.re

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
open ReasonUrql;
22

3-
let client = Client.make(~url="https://formidadog-ql.now.sh", ());
3+
let client =
4+
Client.make(~url="https://formidadog-ql.netlify.app/graphql", ());
45

56
ReactDOMRe.renderToElementWithId(
67
<Context.Provider value=client> <Grid client /> </Context.Provider>,

examples/4-exchanges/src/index.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let debugExchange = (Client.Exchanges.{forward}) =>
1616

1717
let client =
1818
Client.make(
19-
~url="https://formidadog-ql.now.sh",
19+
~url="https://formidadog-ql.netlify.app/graphql",
2020
~exchanges=[|debugExchange, Client.Exchanges.fetchExchange|],
2121
(),
2222
);

0 commit comments

Comments
 (0)