-
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.
fix: handle uncaught errors, support timeout attr (#13)
- Loading branch information
1 parent
7e4d800
commit 5479d3a
Showing
26 changed files
with
302 additions
and
11 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
Empty file.
1 change: 1 addition & 0 deletions
1
...nts/gql-query/__tests__/__snapshots__/client-only-timeout/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 @@ | ||
<div /> |
5 changes: 5 additions & 0 deletions
5
...nts/gql-query/__tests__/__snapshots__/client-only-timeout/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,5 @@ | ||
<div> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> |
5 changes: 5 additions & 0 deletions
5
...ents/gql-query/__tests__/__snapshots__/isomorphic-timeout/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,5 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> |
13 changes: 13 additions & 0 deletions
13
...ents/gql-query/__tests__/__snapshots__/isomorphic-timeout/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,13 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> | ||
<div | ||
id="GENERATED-1" | ||
style="display:none" | ||
> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
...ents/gql-query/__tests__/__snapshots__/isomorphic-timeout/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,9 @@ | ||
<div> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> | ||
<div | ||
id="GENERATED-0" | ||
style="display:none" | ||
/> |
5 changes: 5 additions & 0 deletions
5
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/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,5 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> |
13 changes: 13 additions & 0 deletions
13
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/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,13 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> | ||
<div | ||
id="GENERATED-1" | ||
style="display:none" | ||
> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/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,9 @@ | ||
<div> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> | ||
<div | ||
id="GENERATED-0" | ||
style="display:none" | ||
/> |
5 changes: 5 additions & 0 deletions
5
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/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,5 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> |
13 changes: 13 additions & 0 deletions
13
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/renders.expected/loading.4.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,13 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> | ||
<div | ||
id="GENERATED-1" | ||
style="display:none" | ||
> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/renders.expected/loading.5.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,9 @@ | ||
<div> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> | ||
<div | ||
id="GENERATED-0" | ||
style="display:none" | ||
/> |
13 changes: 13 additions & 0 deletions
13
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/renders.expected/loading.6.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,13 @@ | ||
<div> | ||
<noscript | ||
id="GENERATED-0" | ||
/> | ||
</div> | ||
<div | ||
id="GENERATED-1" | ||
style="display:none" | ||
> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
...nts/gql-query/__tests__/__snapshots__/server-only-timeout/renders.expected/loading.7.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,9 @@ | ||
<div> | ||
<span> | ||
TimeoutError: Timed out after 1ms | ||
</span> | ||
</div> | ||
<div | ||
id="GENERATED-0" | ||
style="display:none" | ||
/> |
21 changes: 21 additions & 0 deletions
21
src/components/gql-query/__tests__/fixtures/client-only-timeout/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,21 @@ | ||
import { gql } from "../../../../../../index"; | ||
static const QUERY = gql` | ||
query($name: String) { | ||
hello(name: $name) | ||
} | ||
`; | ||
|
||
class { | ||
onCreate() { | ||
this.state = { mounted: false } | ||
} | ||
onMount() { | ||
this.state = { mounted: true } | ||
} | ||
} | ||
|
||
<if(state.mounted)> | ||
<gql-query query=QUERY variables={ name: "John" } timeout=1> | ||
<@then|{ error }|><span>${error}</span></@then> | ||
</gql-query> | ||
</if> |
13 changes: 13 additions & 0 deletions
13
src/components/gql-query/__tests__/fixtures/client-only-timeout/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,13 @@ | ||
<!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 /> | ||
<app /> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
src/components/gql-query/__tests__/fixtures/isomorphic-timeout/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,11 @@ | ||
import { gql } from "../../../../../../index"; | ||
static const QUERY = gql` | ||
query($name: String) { | ||
hello(name: $name) | ||
} | ||
`; | ||
class {} | ||
|
||
<gql-query query=QUERY variables={ name: "John" } timeout=1> | ||
<@then|{ error }|><span>${error}</span></@then> | ||
</gql-query> |
13 changes: 13 additions & 0 deletions
13
src/components/gql-query/__tests__/fixtures/isomorphic-timeout/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,13 @@ | ||
<!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 /> | ||
<app /> | ||
</body> | ||
</html> |
10 changes: 10 additions & 0 deletions
10
src/components/gql-query/__tests__/fixtures/server-only-timeout/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,10 @@ | ||
import { gql } from "../../../../../../index"; | ||
static const QUERY = gql` | ||
query($name: String) { | ||
hello(name: $name) | ||
} | ||
`; | ||
|
||
<gql-query query=QUERY variables={ name: "John" } timeout=1> | ||
<@then|{ error }|><span>${error}</span></@then> | ||
</gql-query> |
13 changes: 13 additions & 0 deletions
13
src/components/gql-query/__tests__/fixtures/server-only-timeout/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,13 @@ | ||
<!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 /> | ||
<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
Oops, something went wrong.