Skip to content

Commit

Permalink
fix: add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
neo773 committed Mar 10, 2024
1 parent 51d6b64 commit 7f8a28b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
40 changes: 40 additions & 0 deletions docs/guides/showcase.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 0 additions & 21 deletions docs/operators/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7f8a28b

Please sign in to comment.