Skip to content

Commit 3c5df00

Browse files
committed
chore: lint
1 parent 3f6ae34 commit 3c5df00

File tree

5 files changed

+24
-32
lines changed

5 files changed

+24
-32
lines changed

cloudflare/src/handle.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@ async fn get_app_ctx(
6969
let http = init_http();
7070
let cache = init_cache(env);
7171

72-
match showcase_get_app_ctx::<GraphQLRequest, _, _, _>(
73-
req,
74-
http,
75-
env_io,
76-
Some(file),
77-
Arc::new(cache),
78-
).await? {
72+
match showcase_get_app_ctx::<GraphQLRequest, _, _, _>(req, (http, env_io, Some(file), Arc::new(cache))).await? {
7973
Ok(app_ctx) => {
8074
let app_ctx = Arc::new(app_ctx);
8175
if let Some(file_path) = file_path {

generated/.tailcallrc.schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,13 @@
14161416
],
14171417
"description": "A link to an external JS file that listens on every HTTP request response event."
14181418
},
1419+
"showcase": {
1420+
"description": "`showcase` enables the /showcase/graphql endpoint.",
1421+
"type": [
1422+
"boolean",
1423+
"null"
1424+
]
1425+
},
14191426
"vars": {
14201427
"allOf": [
14211428
{

src/http/showcase.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ impl EnvIO for DummyEnvIO {
3434

3535
pub async fn showcase_get_app_ctx<T: DeserializeOwned + GraphQLRequestLike>(
3636
req: &Request<Body>,
37-
http: impl HttpIO,
38-
env: impl EnvIO,
39-
file: Option<impl FileIO>,
40-
cache: Arc<EntityCache>,
37+
(http, env, file, cache): (Arc<impl HttpIO>, impl EnvIO, Option<impl FileIO>, Arc<EntityCache>),
4138
) -> Result<Result<AppContext, Response<Body>>> {
4239
let url = Url::parse(&req.uri().to_string())?;
4340
let mut query = url.query_pairs();
@@ -86,11 +83,5 @@ pub async fn showcase_get_app_ctx<T: DeserializeOwned + GraphQLRequestLike>(
8683
let http = Arc::new(http);
8784
let env = Arc::new(env);
8885

89-
Ok(Ok(AppContext::new(
90-
blueprint,
91-
http.clone(),
92-
http,
93-
env,
94-
cache,
95-
)))
86+
Ok(Ok(AppContext::new(blueprint, http.clone(), http, env, cache)))
9687
}

tests/http/config/invalid-config.graphql

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/http/showcase.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ mock:
1212
- request:
1313
url: http://example.com/simple.graphql
1414
response:
15-
body: 'schema {
16-
query: Query
17-
}
15+
body: '
16+
schema {
17+
query: Query
18+
}
1819
19-
type User {
20-
id: Int
21-
name: String
22-
}
20+
type User {
21+
id: Int
22+
name: String
23+
}
2324
24-
type Query {
25-
user: User @http(path: "/users/1", baseURL: "http://jsonplaceholder.typicode.com")
26-
}'
25+
type Query {
26+
user: User @http(path: "/users/1", baseURL: "http://jsonplaceholder.typicode.com")
27+
}'
2728
- request:
2829
url: http://example.com/invalid.graphql
2930
response:
@@ -66,9 +67,9 @@ assert:
6667
query: query { user { name } }
6768
response:
6869
body:
69-
data: null
70-
errors:
71-
- message: "Validation Error\n• --> 1:1\n |\n1 | dsjfsjdfjdsfjkdskjfjkds\n | ^---\n |\n = expected type_system_definition\n"
70+
data: null
71+
errors:
72+
- message: "Validation Error\n• --> 1:1\n |\n1 | dsjfsjdfjdsfjkdskjfjkds\n | ^---\n |\n = expected type_system_definition\n"
7273
- request:
7374
method: POST
7475
url: http://localhost:8080/showcase/graphql?config=http%3A%2F%2Fexample.com%2Fsimple.graphql

0 commit comments

Comments
 (0)