-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
21 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
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. |
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