From 7f8a28b7abc5745d95379ea5f81efc000c6cc069 Mon Sep 17 00:00:00 2001 From: neo773 <62795688+neo773@users.noreply.github.com> Date: Mon, 11 Mar 2024 00:16:02 +0530 Subject: [PATCH] fix: add changes --- docs/guides/showcase.md | 40 ++++++++++++++++++++++++++++++++++++++++ docs/operators/server.md | 21 --------------------- 2 files changed, 40 insertions(+), 21 deletions(-) create mode 100644 docs/guides/showcase.md diff --git a/docs/guides/showcase.md b/docs/guides/showcase.md new file mode 100644 index 0000000000..3e1ca57cb4 --- /dev/null +++ b/docs/guides/showcase.md @@ -0,0 +1,40 @@ +--- +title: Showcase +--- + +The `@server` directive's `showcase` option allows for hands-on experimentation with server configurations in a controlled environment. This feature simplifies the process of exploring and testing different settings. + +#### Use cases + +- **Quick Experimentation**: Enables experimenting with random configurations hosted, without the need to restart the server or affect existing setups. + +#### Example Usage: + +`Base schema` +```graphql showLineNumbers +schema @server(showcase: true) { + query: Query +} + +type User { + notId: Int + notName: String +} + +type Query { + notUser: User @http(path: "/users/1", baseURL: "http://jsonplaceholder.typicode.com") +} +``` + +To test it out, append `/showcase/graphql?config=YOUR_CONFIG_URL` to your GraphQL base URL when querying the data. + +![Showcase](/images/docs/showcase.png) + +The above example shows loading a schema file from Tailcall's Github repository [examples](https://github.com/tailcallhq/tailcall/tree/main/examples) and querying it. + + +#### Performance and Security Considerations + +- **Performance Impact**: The `showcase` feature prioritizes flexibility and ease of testing over speed, leading to slower response times due to the overhead of dynamically applying configurations. +- **Security Risk**: There's a potential security risk as it may allow unauthorized access to files and environment variables. +- **Not for Production**: Due to these concerns, this mode is not recommended for production environments. diff --git a/docs/operators/server.md b/docs/operators/server.md index d2d8ccb439..b4b8970c5a 100644 --- a/docs/operators/server.md +++ b/docs/operators/server.md @@ -219,33 +219,12 @@ The key can be of any extension, but it's highly recommended to use standards (` The `@server` directive's `showcase` option allows for hands-on experimentation with server configurations in a controlled environment. This feature simplifies the process of exploring and testing different settings. -#### Use cases - -- **Quick Experimentation**: Enables experimenting with random configurations hosted, without the need to restart the server or affect existing setups. - -#### Example Usage: - ```graphql showLineNumbers schema @server(showcase: true) { query: Query } - -type User { - not_id: Int - not_name: String -} - -type Query { - not_user: User @http(path: "/users/1", baseURL: "http://jsonplaceholder.typicode.com") -} ``` -![Showcase](/images/docs/showcase.png) - -#### Performance Considerations - -Using the `showcase` feature can impact performance, as it prioritizes flexibility and ease of testing over speed. Expect slower response times due to the overhead of dynamically applying configurations. This mode is not recommended for production environments. - ## batchRequests Batching in GraphQL combines requests into one, reducing server round trips.