diff --git a/Cargo.lock b/Cargo.lock index ad9df39e9e2..902ce907081 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -820,12 +820,6 @@ version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cfg-if" version = "1.0.0" @@ -948,16 +942,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "concurrent-queue" version = "2.4.0" @@ -2624,28 +2608,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", - "windows-sys 0.45.0", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - [[package]] name = "js-sys" version = "0.3.69" @@ -2999,15 +2961,6 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - [[package]] name = "maplit" version = "1.0.2" @@ -3197,12 +3150,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -3316,15 +3263,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", -] - [[package]] name = "object" version = "0.32.2" @@ -4202,12 +4140,6 @@ dependencies = [ "bitflags 2.5.0", ] -[[package]] -name = "raw-window-handle" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" - [[package]] name = "rayon" version = "1.10.0" @@ -5257,7 +5189,6 @@ dependencies = [ "ttl_cache", "update-informer", "url", - "webbrowser", "which 6.0.1", ] @@ -6224,23 +6155,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webbrowser" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b6f804e41d0852e16d2eaee61c7e4f7d3e8ffdb7b8ed85886aeb0791fe9fcd" -dependencies = [ - "core-foundation", - "home", - "jni", - "log", - "ndk-context", - "objc", - "raw-window-handle", - "url", - "web-sys", -] - [[package]] name = "webpki-roots" version = "0.25.4" @@ -6324,15 +6238,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -6351,21 +6256,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -6397,12 +6287,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.5", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -6415,12 +6299,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -6433,12 +6311,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -6457,12 +6329,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -6475,12 +6341,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -6493,12 +6353,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -6511,12 +6365,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/Cargo.toml b/Cargo.toml index 083687db412..1a4d27d5dce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,7 +79,6 @@ futures-channel = { version = "0.3.30" } futures-timer = { version = "3.0.3", features = ["wasm-bindgen"] } futures-util = { workspace = true } lru = { version = "0.12.3" } -webbrowser = { version = "1.0.0", features = ["hardened", "disable-wsl"] } async-std = { version = "1.12.0", features = [ "wasm-bindgen-futures", "unstable", diff --git a/README.md b/README.md index 646291f7934..e11bd0c6343 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ The below file is a standard `.graphQL` file, with a few additions such as `@ser ```graphql schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { query: Query } diff --git a/ci-benchmark/benchmark.graphql b/ci-benchmark/benchmark.graphql index aac44a69ad6..56d3a5e0411 100644 --- a/ci-benchmark/benchmark.graphql +++ b/ci-benchmark/benchmark.graphql @@ -1,6 +1,4 @@ -schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") - @upstream(baseURL: "http://jsonplaceholder.typicode.com") { +schema @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com") { query: Query } diff --git a/examples/apollo-tracing.graphql b/examples/apollo-tracing.graphql index d1718b676d6..550a174bae2 100644 --- a/examples/apollo-tracing.graphql +++ b/examples/apollo-tracing.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com") @telemetry(export: {apollo: {apiKey: "1234", graphRef: "abc@123"}}) { query: Query diff --git a/examples/auth.graphql b/examples/auth.graphql index f8d50d242ee..07b69ea0a0c 100644 --- a/examples/auth.graphql +++ b/examples/auth.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(id: "auth-basic", type: Htpasswd, src: ".htpasswd") @link(id: "auth-jwt", type: Jwks, src: ".jwks") { diff --git a/examples/call.graphql b/examples/call.graphql index 76da11d1d05..f0af6d6a517 100644 --- a/examples/call.graphql +++ b/examples/call.graphql @@ -1,4 +1,4 @@ -schema @server(graphiql: true) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { +schema @upstream(baseURL: "http://jsonplaceholder.typicode.com") { query: Query } diff --git a/examples/cors.graphql b/examples/cors.graphql index 3d4c4af23aa..7e1a78a34b6 100644 --- a/examples/cors.graphql +++ b/examples/cors.graphql @@ -1,7 +1,6 @@ schema @server( port: 8000 - graphiql: true hostname: "0.0.0.0" headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}} ) diff --git a/examples/graphql-composition.graphql b/examples/graphql-composition.graphql index e7079e12502..4666a2af82e 100644 --- a/examples/graphql-composition.graphql +++ b/examples/graphql-composition.graphql @@ -3,7 +3,7 @@ # and then you can run this example and test it on 8001 port schema - @server(port: 8001, graphiql: true, queryValidation: false, hostname: "0.0.0.0") + @server(port: 8001, queryValidation: false, hostname: "0.0.0.0") @upstream(baseURL: "http://localhost:8000/graphql", httpCache: true, batch: {delay: 1}) { query: Query } diff --git a/examples/grpc.graphql b/examples/grpc.graphql index e358218d714..2828b82d226 100644 --- a/examples/grpc.graphql +++ b/examples/grpc.graphql @@ -1,6 +1,6 @@ # for test upstream server see [repo](https://github.com/tailcallhq/rust-grpc) schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(baseURL: "http://localhost:50051", httpCache: true, batch: {delay: 10}) @link(id: "news", src: "../tailcall-fixtures/fixtures/protobuf/news.proto", type: Protobuf) { query: Query diff --git a/examples/jsonplaceholder.json b/examples/jsonplaceholder.json index e50eb02ed27..f38a74e343e 100644 --- a/examples/jsonplaceholder.json +++ b/examples/jsonplaceholder.json @@ -1,7 +1,6 @@ { "$schema": "./.tailcallrc.schema.json", "server": { - "graphiql": true, "hostname": "0.0.0.0", "port": 8000 }, diff --git a/examples/jsonplaceholder.yml b/examples/jsonplaceholder.yml index c6224182f2b..17bdbb7e8eb 100644 --- a/examples/jsonplaceholder.yml +++ b/examples/jsonplaceholder.yml @@ -1,5 +1,4 @@ server: - graphiql: true hostname: 0.0.0.0 port: 8000 upstream: diff --git a/examples/jsonplaceholder_batch.graphql b/examples/jsonplaceholder_batch.graphql index 4c5eb450818..bb54487aab3 100644 --- a/examples/jsonplaceholder_batch.graphql +++ b/examples/jsonplaceholder_batch.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true, batch: {delay: 1, maxSize: 1000}) { query: Query } diff --git a/examples/jsonplaceholder_batch.json b/examples/jsonplaceholder_batch.json index 9d2c754e4aa..9b46cafcf64 100644 --- a/examples/jsonplaceholder_batch.json +++ b/examples/jsonplaceholder_batch.json @@ -1,7 +1,6 @@ { "server": { - "port": 8000, - "graphiql": true + "port": 8000 }, "upstream": { "baseURL": "http://jsonplaceholder.typicode.com", diff --git a/examples/jsonplaceholder_batch.yml b/examples/jsonplaceholder_batch.yml index d1f1c9fb7b4..1a280b638e3 100644 --- a/examples/jsonplaceholder_batch.yml +++ b/examples/jsonplaceholder_batch.yml @@ -1,6 +1,5 @@ server: port: 8000 - graphiql: true upstream: baseURL: http://jsonplaceholder.typicode.com httpCache: true diff --git a/examples/jsonplaceholder_http_2.graphql b/examples/jsonplaceholder_http_2.graphql index 5ac363643f3..f09c2d33d14 100644 --- a/examples/jsonplaceholder_http_2.graphql +++ b/examples/jsonplaceholder_http_2.graphql @@ -1,5 +1,5 @@ schema - @server(port: 3000, graphiql: true, queryValidation: false, hostname: "0.0.0.0", version: HTTP2) + @server(port: 3000, queryValidation: false, hostname: "0.0.0.0", version: HTTP2) @link(type: Cert, src: "./example.crt") @link(type: Key, src: "./example.key") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { diff --git a/examples/jsonplaceholder_script.graphql b/examples/jsonplaceholder_script.graphql index ab23e05e477..0cfab828009 100644 --- a/examples/jsonplaceholder_script.graphql +++ b/examples/jsonplaceholder_script.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(type: Script, src: "scripts/echo.js") { query: Query diff --git a/examples/rest-api.graphql b/examples/rest-api.graphql index 11191d35861..59d39e86019 100644 --- a/examples/rest-api.graphql +++ b/examples/rest-api.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(type: Operation, src: "operations/routes.graphql") { query: Query diff --git a/examples/telemetry-otlp.graphql b/examples/telemetry-otlp.graphql index e256dfd79af..a6775f6c5ea 100644 --- a/examples/telemetry-otlp.graphql +++ b/examples/telemetry-otlp.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(type: Operation, src: "operations/routes.graphql") @link(id: "news", src: "../tailcall-fixtures/fixtures/protobuf/news.proto", type: Protobuf) diff --git a/examples/telemetry-prometheus.graphql b/examples/telemetry-prometheus.graphql index 0fe17bd38d8..e0ff49f1fb6 100644 --- a/examples/telemetry-prometheus.graphql +++ b/examples/telemetry-prometheus.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @telemetry(export: {prometheus: {path: "/metrics"}}) { query: Query diff --git a/examples/telemetry-stdout.graphql b/examples/telemetry-stdout.graphql index 572d980a1e6..1907d6e2b41 100644 --- a/examples/telemetry-stdout.graphql +++ b/examples/telemetry-stdout.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @telemetry(export: {stdout: {pretty: true}}) { query: Query diff --git a/generated/.tailcallrc.graphql b/generated/.tailcallrc.graphql index cbba8207562..74378d082f8 100644 --- a/generated/.tailcallrc.graphql +++ b/generated/.tailcallrc.graphql @@ -237,11 +237,6 @@ directive @server( """ globalResponseTimeout: Int """ - `graphiql` activates the GraphiQL IDE at the root path within Tailcall, a tool for - query development and testing. @default `false`. - """ - graphiql: Boolean - """ `headers` contains key-value pairs that are included as default headers in server responses, allowing for consistent header management across all responses. """ diff --git a/generated/.tailcallrc.schema.json b/generated/.tailcallrc.schema.json index 265020e9f4d..d79fd4ec1af 100644 --- a/generated/.tailcallrc.schema.json +++ b/generated/.tailcallrc.schema.json @@ -961,13 +961,6 @@ ], "format": "int64" }, - "graphiql": { - "description": "`graphiql` activates the GraphiQL IDE at the root path within Tailcall, a tool for query development and testing. @default `false`.", - "type": [ - "boolean", - "null" - ] - }, "headers": { "description": "`headers` contains key-value pairs that are included as default headers in server responses, allowing for consistent header management across all responses.", "anyOf": [ diff --git a/src/blueprint/server.rs b/src/blueprint/server.rs index b62f8e63eb1..5caaad887f3 100644 --- a/src/blueprint/server.rs +++ b/src/blueprint/server.rs @@ -19,7 +19,6 @@ pub struct Server { pub enable_apollo_tracing: bool, pub enable_cache_control_header: bool, pub enable_set_cookie_header: bool, - pub enable_graphiql: bool, pub enable_introspection: bool, pub enable_query_validation: bool, pub enable_response_validation: bool, @@ -134,7 +133,6 @@ impl TryFrom for Server { enable_apollo_tracing: (config_server).enable_apollo_tracing(), enable_cache_control_header: (config_server).enable_cache_control(), enable_set_cookie_header: (config_server).enable_set_cookies(), - enable_graphiql: (config_server).enable_graphiql(), enable_introspection: (config_server).enable_introspection(), enable_query_validation: (config_server).enable_query_validation(), enable_response_validation: (config_server).enable_http_validation(), diff --git a/src/cli/server/http_1.rs b/src/cli/server/http_1.rs index 6d725483cd4..2fa86de2b07 100644 --- a/src/cli/server/http_1.rs +++ b/src/cli/server/http_1.rs @@ -33,7 +33,7 @@ pub async fn start_http_1( let builder = hyper::Server::try_bind(&addr) .map_err(CLIError::from)? .http1_pipeline_flush(sc.app_ctx.blueprint.server.pipeline_flush); - super::log_launch_and_open_browser(sc.as_ref()); + super::log_launch(sc.as_ref()); if let Some(sender) = server_up_sender { sender diff --git a/src/cli/server/http_2.rs b/src/cli/server/http_2.rs index 0066d8bdbf3..97ebe8df226 100644 --- a/src/cli/server/http_2.rs +++ b/src/cli/server/http_2.rs @@ -45,7 +45,7 @@ pub async fn start_http_2( let builder = Server::builder(acceptor).http2_only(true); - super::log_launch_and_open_browser(sc.as_ref()); + super::log_launch(sc.as_ref()); if let Some(sender) = server_up_sender { sender diff --git a/src/cli/server/mod.rs b/src/cli/server/mod.rs index d5c571a4d25..c547c774e39 100644 --- a/src/cli/server/mod.rs +++ b/src/cli/server/mod.rs @@ -7,18 +7,15 @@ pub use server::Server; use self::server_config::ServerConfig; -fn log_launch_and_open_browser(sc: &ServerConfig) { +fn log_launch(sc: &ServerConfig) { let addr = sc.addr().to_string(); tracing::info!( "🚀 Tailcall launched at [{}] over {}", addr, sc.http_version() ); - if sc.graphiql() { - let url = sc.graphiql_url(); - let url = format!("https://tailcall.run/playground/?u={}/graphql", url); - tracing::info!("🌍 Playground: {}", url); - let _ = webbrowser::open(url.as_str()); - } + let url = sc.graphiql_url(); + let url = format!("https://tailcall.run/playground/?u={}/graphql", url); + tracing::info!("🌍 Playground: {}", url); } diff --git a/src/cli/server/server_config.rs b/src/cli/server/server_config.rs index 7538633f058..e1b60bc0e1f 100644 --- a/src/cli/server/server_config.rs +++ b/src/cli/server/server_config.rs @@ -66,8 +66,4 @@ impl ServerConfig { format!("{}://{}", protocol, addr) } - - pub fn graphiql(&self) -> bool { - self.blueprint.server.enable_graphiql - } } diff --git a/src/config/server.rs b/src/config/server.rs index f83e88f88a4..f8e7e609693 100644 --- a/src/config/server.rs +++ b/src/config/server.rs @@ -40,11 +40,6 @@ pub struct Server { /// termination, acting as a safeguard against long-running queries. pub global_response_timeout: Option, - #[serde(default, skip_serializing_if = "is_default")] - /// `graphiql` activates the GraphiQL IDE at the root path within Tailcall, - /// a tool for query development and testing. @default `false`. - pub graphiql: Option, - #[serde(default, skip_serializing_if = "is_default")] /// `hostname` sets the server hostname. pub hostname: Option, @@ -134,9 +129,7 @@ impl Server { pub fn enable_apollo_tracing(&self) -> bool { self.apollo_tracing.unwrap_or(false) } - pub fn enable_graphiql(&self) -> bool { - self.graphiql.unwrap_or(false) - } + pub fn get_global_response_timeout(&self) -> i64 { self.global_response_timeout.unwrap_or(0) } diff --git a/src/http/request_handler.rs b/src/http/request_handler.rs index 862de24a409..c6ce8ab8341 100644 --- a/src/http/request_handler.rs +++ b/src/http/request_handler.rs @@ -4,11 +4,12 @@ use std::sync::Arc; use anyhow::Result; use async_graphql::ServerError; -use hyper::header::{self}; +use hyper::header::{self, CONTENT_TYPE}; use hyper::http::Method; use hyper::{Body, HeaderMap, Request, Response, StatusCode}; use opentelemetry::trace::SpanKind; use opentelemetry_semantic_conventions::trace::{HTTP_REQUEST_METHOD, HTTP_ROUTE}; +use prometheus::{Encoder, ProtobufEncoder, TextEncoder, TEXT_FORMAT}; use serde::de::DeserializeOwned; use tracing::Instrument; use tracing_opentelemetry::OpenTelemetrySpanExt; @@ -17,9 +18,33 @@ use super::request_context::RequestContext; use super::telemetry::{get_response_status_code, RequestCounter}; use super::{showcase, telemetry, AppContext}; use crate::async_graphql_hyper::{GraphQLRequestLike, GraphQLResponse}; +use crate::blueprint::telemetry::TelemetryExporter; +use crate::config::{PrometheusExporter, PrometheusFormat}; pub const API_URL_PREFIX: &str = "/api"; +fn prometheus_metrics(prometheus_exporter: &PrometheusExporter) -> Result> { + let metric_families = prometheus::default_registry().gather(); + let mut buffer = vec![]; + + match prometheus_exporter.format { + PrometheusFormat::Text => TextEncoder::new().encode(&metric_families, &mut buffer)?, + PrometheusFormat::Protobuf => { + ProtobufEncoder::new().encode(&metric_families, &mut buffer)? + } + }; + + let content_type = match prometheus_exporter.format { + PrometheusFormat::Text => TEXT_FORMAT, + PrometheusFormat::Protobuf => prometheus::PROTOBUF_FORMAT, + }; + + Ok(Response::builder() + .status(200) + .header(CONTENT_TYPE, content_type) + .body(Body::from(buffer))?) +} + fn not_found() -> Result> { Ok(Response::builder() .status(StatusCode::NOT_FOUND) @@ -234,6 +259,17 @@ async fn handle_request_inner( graphql_request::(req, &app_ctx, req_counter).await } + hyper::Method::GET => { + if let Some(TelemetryExporter::Prometheus(prometheus)) = + app_ctx.blueprint.telemetry.export.as_ref() + { + if req.uri().path() == prometheus.path { + return prometheus_metrics(prometheus); + } + }; + + not_found() + } _ => not_found(), } } diff --git a/tailcall-fixtures/fixtures/configs/user-posts.graphql b/tailcall-fixtures/fixtures/configs/user-posts.graphql index 079c492893d..e45f9aa5697 100644 --- a/tailcall-fixtures/fixtures/configs/user-posts.graphql +++ b/tailcall-fixtures/fixtures/configs/user-posts.graphql @@ -1,5 +1,5 @@ schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { query: Query } diff --git a/tests/core/snapshots/apollo-tracing.md_merged.snap b/tests/core/snapshots/apollo-tracing.md_merged.snap index c65bafe30d3..655fb0c12e1 100644 --- a/tests/core/snapshots/apollo-tracing.md_merged.snap +++ b/tests/core/snapshots/apollo-tracing.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream { +schema @server(hostname: "0.0.0.0", port: 8000) @upstream { query: Query } diff --git a/tests/core/snapshots/auth-basic.md_merged.snap b/tests/core/snapshots/auth-basic.md_merged.snap index 4e174cdbc43..990292607fa 100644 --- a/tests/core/snapshots/auth-basic.md_merged.snap +++ b/tests/core/snapshots/auth-basic.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) { +schema @server(port: 8000) @upstream @link(id: "htpasswd", src: ".htpasswd", type: Htpasswd) { query: Query mutation: Mutation } diff --git a/tests/core/snapshots/auth-jwt.md_merged.snap b/tests/core/snapshots/auth-jwt.md_merged.snap index 9ea0b077da8..69bf7be2838 100644 --- a/tests/core/snapshots/auth-jwt.md_merged.snap +++ b/tests/core/snapshots/auth-jwt.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream @link(id: "jwks", src: "jwks.json", type: Jwks) { +schema @server(port: 8000) @upstream @link(id: "jwks", src: "jwks.json", type: Jwks) { query: Query mutation: Mutation } diff --git a/tests/core/snapshots/call-graphql-datasource.md_merged.snap b/tests/core/snapshots/call-graphql-datasource.md_merged.snap index ec344567c44..12db968e5d4 100644 --- a/tests/core/snapshots/call-graphql-datasource.md_merged.snap +++ b/tests/core/snapshots/call-graphql-datasource.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { +schema @server(hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { query: Query } diff --git a/tests/core/snapshots/call-operator.md_merged.snap b/tests/core/snapshots/call-operator.md_merged.snap index ad316db56f3..dc9d89aabcc 100644 --- a/tests/core/snapshots/call-operator.md_merged.snap +++ b/tests/core/snapshots/call-operator.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { +schema @server(hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/grpc-batch.md_merged.snap b/tests/core/snapshots/grpc-batch.md_merged.snap index 14626ab1371..26d6e418032 100644 --- a/tests/core/snapshots/grpc-batch.md_merged.snap +++ b/tests/core/snapshots/grpc-batch.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { +schema @server(port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/grpc-error.md_merged.snap b/tests/core/snapshots/grpc-error.md_merged.snap index 54e5f0b144a..385aa86cced 100644 --- a/tests/core/snapshots/grpc-error.md_merged.snap +++ b/tests/core/snapshots/grpc-error.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { +schema @server(port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/grpc-override-url-from-upstream.md_merged.snap b/tests/core/snapshots/grpc-override-url-from-upstream.md_merged.snap index a42f6b79917..b4310be9794 100644 --- a/tests/core/snapshots/grpc-override-url-from-upstream.md_merged.snap +++ b/tests/core/snapshots/grpc-override-url-from-upstream.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://not-a-valid-grpc-url.com", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { +schema @server(port: 8000) @upstream(baseURL: "http://not-a-valid-grpc-url.com", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap b/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap index 885b23f0628..627c6027380 100644 --- a/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap +++ b/tests/core/snapshots/grpc-proto-with-same-package.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://localhost:50051") @link(src: "foo.proto", type: Protobuf) @link(src: "bar.proto", type: Protobuf) { +schema @server(port: 8000) @upstream(baseURL: "http://localhost:50051") @link(src: "foo.proto", type: Protobuf) @link(src: "bar.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/grpc-simple.md_merged.snap b/tests/core/snapshots/grpc-simple.md_merged.snap index 54e5f0b144a..385aa86cced 100644 --- a/tests/core/snapshots/grpc-simple.md_merged.snap +++ b/tests/core/snapshots/grpc-simple.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { +schema @server(port: 8000) @upstream(batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap b/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap index 0ad2090a9fa..ccab5789079 100644 --- a/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap +++ b/tests/core/snapshots/grpc-url-from-upstream.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { +schema @server(port: 8000) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/io-cache.md_merged.snap b/tests/core/snapshots/io-cache.md_merged.snap index 7669ff0baad..87b91f625b7 100644 --- a/tests/core/snapshots/io-cache.md_merged.snap +++ b/tests/core/snapshots/io-cache.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { +schema @server(hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { query: Query } diff --git a/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap b/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap index a5a42cbbac6..e49ac9d01ab 100644 --- a/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap +++ b/tests/core/snapshots/jsonplaceholder-call-post.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 100, headers: []}, httpCache: true) { +schema @server(hostname: "0.0.0.0", port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com", batch: {delay: 100, headers: []}, httpCache: true) { query: Query } diff --git a/tests/core/snapshots/test-enum-default.md_merged.snap b/tests/core/snapshots/test-enum-default.md_merged.snap index fedfe3b663b..0225e1e26a8 100644 --- a/tests/core/snapshots/test-enum-default.md_merged.snap +++ b/tests/core/snapshots/test-enum-default.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8080) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "./service.proto", type: Protobuf) { +schema @server(port: 8080) @upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: []}, httpCache: true) @link(id: "news", src: "./service.proto", type: Protobuf) { query: Query } diff --git a/tests/core/snapshots/test-params-as-body.md_merged.snap b/tests/core/snapshots/test-params-as-body.md_merged.snap index 8d9f37e2a69..321ec2ce72c 100644 --- a/tests/core/snapshots/test-params-as-body.md_merged.snap +++ b/tests/core/snapshots/test-params-as-body.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { +schema @server(port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { query: Query } diff --git a/tests/core/snapshots/test-scalars.md_merged.snap b/tests/core/snapshots/test-scalars.md_merged.snap index 69c62c196ea..5fd1d6df740 100644 --- a/tests/core/snapshots/test-scalars.md_merged.snap +++ b/tests/core/snapshots/test-scalars.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(graphiql: true, hostname: "localhost", port: 8000) @upstream { +schema @server(hostname: "localhost", port: 8000) @upstream { query: Query } diff --git a/tests/core/snapshots/test-set-cookie-headers.md_merged.snap b/tests/core/snapshots/test-set-cookie-headers.md_merged.snap index 86607839540..d3da154ead9 100644 --- a/tests/core/snapshots/test-set-cookie-headers.md_merged.snap +++ b/tests/core/snapshots/test-set-cookie-headers.md_merged.snap @@ -2,7 +2,7 @@ source: tests/core/spec.rs expression: merged --- -schema @server(headers: {setCookies: true}, graphiql: true, hostname: "0.0.0.0", port: 8080) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { +schema @server(headers: {setCookies: true}, hostname: "0.0.0.0", port: 8080) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { query: Query } diff --git a/tests/execution/apollo-tracing.md b/tests/execution/apollo-tracing.md index e534dc07808..72ffd9b01b5 100644 --- a/tests/execution/apollo-tracing.md +++ b/tests/execution/apollo-tracing.md @@ -2,7 +2,7 @@ ```graphql @server schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @telemetry(export: {apollo: {apiKey: "", graphRef: "tailcall-demo-3@current"}}) { query: Query } diff --git a/tests/execution/auth-basic.md b/tests/execution/auth-basic.md index 95f413e2aa7..b8af3de0b04 100644 --- a/tests/execution/auth-basic.md +++ b/tests/execution/auth-basic.md @@ -1,7 +1,7 @@ # Auth with BasicAuth ```graphql @server -schema @server(port: 8000, graphiql: true) @link(id: "htpasswd", type: Htpasswd, src: ".htpasswd") { +schema @server(port: 8000) @link(id: "htpasswd", type: Htpasswd, src: ".htpasswd") { query: Query mutation: Mutation } diff --git a/tests/execution/auth-jwt.md b/tests/execution/auth-jwt.md index d91aeb4f223..64f3b53ad8d 100644 --- a/tests/execution/auth-jwt.md +++ b/tests/execution/auth-jwt.md @@ -1,7 +1,7 @@ # Auth with JWT loaded from expr ```graphql @server -schema @server(port: 8000, graphiql: true) @link(id: "jwks", type: Jwks, src: "jwks.json") { +schema @server(port: 8000) @link(id: "jwks", type: Jwks, src: "jwks.json") { query: Query mutation: Mutation } diff --git a/tests/execution/call-graphql-datasource.md b/tests/execution/call-graphql-datasource.md index df32c6d7ad2..f58d1aac9c7 100644 --- a/tests/execution/call-graphql-datasource.md +++ b/tests/execution/call-graphql-datasource.md @@ -2,7 +2,7 @@ ```graphql @server schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { query: Query } diff --git a/tests/execution/call-operator.md b/tests/execution/call-operator.md index cfff8e49cea..404ad97a046 100644 --- a/tests/execution/call-operator.md +++ b/tests/execution/call-operator.md @@ -38,7 +38,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/grpc-batch.md b/tests/execution/grpc-batch.md index 61072baec61..f49eab5a359 100644 --- a/tests/execution/grpc-batch.md +++ b/tests/execution/grpc-batch.md @@ -38,7 +38,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(httpCache: true, batch: {delay: 10}) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/grpc-error.md b/tests/execution/grpc-error.md index 2d0ebe26614..270ddbb4d0a 100644 --- a/tests/execution/grpc-error.md +++ b/tests/execution/grpc-error.md @@ -38,7 +38,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(httpCache: true, batch: {delay: 10}) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/grpc-override-url-from-upstream.md b/tests/execution/grpc-override-url-from-upstream.md index 718d5a04dec..d8ba7b17dc2 100644 --- a/tests/execution/grpc-override-url-from-upstream.md +++ b/tests/execution/grpc-override-url-from-upstream.md @@ -38,7 +38,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(httpCache: true, batch: {delay: 10}, baseURL: "http://not-a-valid-grpc-url.com") @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/grpc-proto-with-same-package.md b/tests/execution/grpc-proto-with-same-package.md index 67925aa28e2..708864cae09 100644 --- a/tests/execution/grpc-proto-with-same-package.md +++ b/tests/execution/grpc-proto-with-same-package.md @@ -35,7 +35,7 @@ service BarService { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(baseURL: "http://localhost:50051") @link(src: "foo.proto", type: Protobuf) @link(src: "bar.proto", type: Protobuf) { diff --git a/tests/execution/grpc-simple.md b/tests/execution/grpc-simple.md index c38344903ed..7954c246db1 100644 --- a/tests/execution/grpc-simple.md +++ b/tests/execution/grpc-simple.md @@ -38,7 +38,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(httpCache: true, batch: {delay: 10}) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/grpc-url-from-upstream.md b/tests/execution/grpc-url-from-upstream.md index db2c8ac4af3..9437271ca53 100644 --- a/tests/execution/grpc-url-from-upstream.md +++ b/tests/execution/grpc-url-from-upstream.md @@ -38,7 +38,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(httpCache: true, batch: {delay: 10}, baseURL: "http://localhost:50051") @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/io-cache.md b/tests/execution/io-cache.md index 16f3161e15b..412468cd4b3 100644 --- a/tests/execution/io-cache.md +++ b/tests/execution/io-cache.md @@ -2,7 +2,7 @@ ```graphql @server schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true) { query: Query } diff --git a/tests/execution/jsonplaceholder-call-post.md b/tests/execution/jsonplaceholder-call-post.md index 0b4674de28f..55156b6bd72 100644 --- a/tests/execution/jsonplaceholder-call-post.md +++ b/tests/execution/jsonplaceholder-call-post.md @@ -2,7 +2,7 @@ ```graphql @server schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true, batch: {delay: 100}) { query: Query } diff --git a/tests/execution/test-duplicated-link.md b/tests/execution/test-duplicated-link.md index 82440af7862..858db7a67bf 100644 --- a/tests/execution/test-duplicated-link.md +++ b/tests/execution/test-duplicated-link.md @@ -6,7 +6,7 @@ expect_validation_error: true ```graphql @file:jsonplaceholder.graphql schema - @server(port: 8000, graphiql: true, hostname: "0.0.0.0") + @server(port: 8000, hostname: "0.0.0.0") @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: true, batch: {delay: 100}) { query: Query } diff --git a/tests/execution/test-enum-default.md b/tests/execution/test-enum-default.md index 37c163fc68b..68f059b55f1 100644 --- a/tests/execution/test-enum-default.md +++ b/tests/execution/test-enum-default.md @@ -31,7 +31,7 @@ message NewsList { ```graphql @server # for test upstream server see [repo](https://github.com/tailcallhq/rust-grpc) schema - @server(port: 8080, graphiql: true) + @server(port: 8080) @upstream(baseURL: "http://localhost:50051", httpCache: true, batch: {delay: 10}) @link(id: "news", src: "./service.proto", type: Protobuf) { query: Query diff --git a/tests/execution/test-grpc-group-by.md b/tests/execution/test-grpc-group-by.md index 368808f3b8d..f9f95ac2d87 100644 --- a/tests/execution/test-grpc-group-by.md +++ b/tests/execution/test-grpc-group-by.md @@ -42,7 +42,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(httpCache: true, batch: {delay: 10}) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/test-grpc-nested-data.md b/tests/execution/test-grpc-nested-data.md index 6a601f3e147..82ff8ee9ad9 100644 --- a/tests/execution/test-grpc-nested-data.md +++ b/tests/execution/test-grpc-nested-data.md @@ -42,7 +42,7 @@ message NewsList { ```graphql @server schema - @server(port: 8000, graphiql: true) + @server(port: 8000) @upstream(httpCache: true, batch: {delay: 10}) @link(id: "news", src: "news.proto", type: Protobuf) { query: Query diff --git a/tests/execution/test-params-as-body.md b/tests/execution/test-params-as-body.md index f9d2c346b3a..98aa8a661fb 100644 --- a/tests/execution/test-params-as-body.md +++ b/tests/execution/test-params-as-body.md @@ -1,7 +1,7 @@ # Http with args as body ```graphql @server -schema @server(port: 8000, graphiql: true) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { +schema @server(port: 8000) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { query: Query } diff --git a/tests/execution/test-scalars.md b/tests/execution/test-scalars.md index ec54cd9ca53..86d16e2a135 100644 --- a/tests/execution/test-scalars.md +++ b/tests/execution/test-scalars.md @@ -6,7 +6,7 @@ scalar PhoneNumber scalar Date scalar Url -schema @server(port: 8000, graphiql: true, hostname: "localhost") { +schema @server(port: 8000, hostname: "localhost") { query: Query } diff --git a/tests/execution/test-set-cookie-headers.md b/tests/execution/test-set-cookie-headers.md index bd5a1e73440..7a0740a62b4 100644 --- a/tests/execution/test-set-cookie-headers.md +++ b/tests/execution/test-set-cookie-headers.md @@ -2,7 +2,7 @@ ```graphql @server schema - @server(port: 8080, graphiql: true, hostname: "0.0.0.0", headers: {setCookies: true}) + @server(port: 8080, hostname: "0.0.0.0", headers: {setCookies: true}) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { query: Query }