-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: support multi client
- Loading branch information
Showing
53 changed files
with
963 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...utation/__tests__/__snapshots__/run-mutation-multi-client/renders.expected/loading.0.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<h1> | ||
Messages | ||
</h1> | ||
<span /> | ||
<span /> | ||
<button> | ||
Add | ||
</button> | ||
<h1> | ||
Messages | ||
</h1> | ||
<span /> | ||
<span /> | ||
<button> | ||
Add(alt) | ||
</button> |
18 changes: 18 additions & 0 deletions
18
...mutation/__tests__/__snapshots__/run-mutation-multi-client/renders.expected/step-0.0.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<h1> | ||
Messages | ||
</h1> | ||
<span /> | ||
<span> | ||
executing | ||
</span> | ||
<button> | ||
Add | ||
</button> | ||
<h1> | ||
Messages | ||
</h1> | ||
<span /> | ||
<span /> | ||
<button> | ||
Add(alt) | ||
</button> |
18 changes: 18 additions & 0 deletions
18
...mutation/__tests__/__snapshots__/run-mutation-multi-client/renders.expected/step-0.1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<h1> | ||
Messages | ||
</h1> | ||
<span> | ||
Hello | ||
</span> | ||
<span /> | ||
<button> | ||
Add | ||
</button> | ||
<h1> | ||
Messages | ||
</h1> | ||
<span /> | ||
<span /> | ||
<button> | ||
Add(alt) | ||
</button> |
20 changes: 20 additions & 0 deletions
20
...mutation/__tests__/__snapshots__/run-mutation-multi-client/renders.expected/step-1.0.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<h1> | ||
Messages | ||
</h1> | ||
<span> | ||
Hello | ||
</span> | ||
<span /> | ||
<button> | ||
Add | ||
</button> | ||
<h1> | ||
Messages | ||
</h1> | ||
<span /> | ||
<span> | ||
executing | ||
</span> | ||
<button> | ||
Add(alt) | ||
</button> |
20 changes: 20 additions & 0 deletions
20
...mutation/__tests__/__snapshots__/run-mutation-multi-client/renders.expected/step-1.1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<h1> | ||
Messages | ||
</h1> | ||
<span> | ||
Hello | ||
</span> | ||
<span /> | ||
<button> | ||
Add | ||
</button> | ||
<h1> | ||
Messages | ||
</h1> | ||
<span> | ||
Hello(Alt) | ||
</span> | ||
<span /> | ||
<button> | ||
Add(alt) | ||
</button> |
29 changes: 29 additions & 0 deletions
29
...components/gql-mutation/__tests__/fixtures/run-mutation-multi-client/components/app.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { gql } from "../../../../../../index"; | ||
|
||
static const MUTATION = gql` | ||
mutation addMessage( | ||
$text: String! | ||
) { | ||
addMessage(text: $text) | ||
} | ||
`; | ||
|
||
class { | ||
handleClick(mutate, e) { | ||
mutate({ text: "Hello" }); | ||
} | ||
} | ||
|
||
<gql-mutation|mutate, results| mutation=MUTATION> | ||
<h1>Messages</h1> | ||
<span>${results.data && results.data.addMessage}</span> | ||
<span>${results.fetching ? "executing" : ""}</span> | ||
<button on-click("handleClick", mutate)>Add</button> | ||
</gql-mutation> | ||
|
||
<gql-mutation|mutate, results| mutation=MUTATION name="alt"> | ||
<h1>Messages</h1> | ||
<span>${results.data && results.data.addMessage}</span> | ||
<span>${results.fetching ? "executing" : ""}</span> | ||
<button on-click("handleClick", mutate)>Add(alt)</button> | ||
</gql-mutation> |
14 changes: 14 additions & 0 deletions
14
src/components/gql-mutation/__tests__/fixtures/run-mutation-multi-client/index.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Simple Example</title> | ||
<esbuild-assets/> | ||
</head> | ||
<body> | ||
<gql-client url=input.graphqlURL /> | ||
<gql-client name="alt" url=input.graphqlURLAlt /> | ||
<app /> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
7 changes: 7 additions & 0 deletions
7
...ql-query/__tests__/__snapshots__/client-only-multi-client/renders.expected/loading.1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div /> | ||
<div> | ||
<h3> | ||
Alt client | ||
</h3> | ||
<div /> | ||
</div> |
11 changes: 11 additions & 0 deletions
11
...ql-query/__tests__/__snapshots__/client-only-multi-client/renders.expected/loading.2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div> | ||
<span> | ||
Hello world! | ||
</span> | ||
</div> | ||
<div> | ||
<h3> | ||
Alt client | ||
</h3> | ||
<div /> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
...ql-query/__tests__/__snapshots__/client-only-multi-client/renders.expected/loading.3.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div> | ||
<span> | ||
Hello world! | ||
</span> | ||
</div> | ||
<div> | ||
<h3> | ||
Alt client | ||
</h3> | ||
<div> | ||
<span> | ||
Hello world!(Alt) | ||
</span> | ||
</div> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
...gql-query/__tests__/__snapshots__/isomorphic-multi-client/renders.expected/loading.0.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> | ||
<div> | ||
<h3> | ||
Alt client | ||
</h3> | ||
<div> | ||
<noscript | ||
id="GENERATED-1" | ||
/> | ||
</div> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
...gql-query/__tests__/__snapshots__/isomorphic-multi-client/renders.expected/loading.1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> | ||
<div> | ||
<h3> | ||
Alt client | ||
</h3> | ||
<div> | ||
<noscript | ||
id="GENERATED-1" | ||
/> | ||
</div> | ||
</div> | ||
<div | ||
id="GENERATED-2" | ||
style="display:none" | ||
> | ||
<span> | ||
Hello world! | ||
</span> | ||
</div> |
Oops, something went wrong.