Skip to content

Commit

Permalink
feat: migrate playground (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitksingh1490 authored May 2, 2024
1 parent fc96336 commit 97dc20f
Show file tree
Hide file tree
Showing 76 changed files with 124 additions and 308 deletions.
152 changes: 0 additions & 152 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 1 addition & 3 deletions ci-benchmark/benchmark.graphql
Original file line number Diff line number Diff line change
@@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion examples/apollo-tracing.graphql
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/auth.graphql
Original file line number Diff line number Diff line change
@@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion examples/call.graphql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schema @server(graphiql: true) @upstream(baseURL: "http://jsonplaceholder.typicode.com") {
schema @upstream(baseURL: "http://jsonplaceholder.typicode.com") {
query: Query
}

Expand Down
1 change: 0 additions & 1 deletion examples/cors.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
schema
@server(
port: 8000
graphiql: true
hostname: "0.0.0.0"
headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}}
)
Expand Down
2 changes: 1 addition & 1 deletion examples/graphql-composition.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc-reflection.graphql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# for test upstream server see [repo](https://github.com/tailcallhq/tailcall/tree/main/tailcall-upstream-grpc)
schema
@server(port: 8000, graphiql: true)
@server(port: 8000)
@upstream(baseURL: "http://localhost:50051", httpCache: true, batch: {delay: 10})
@link(src: "http://localhost:50051", type: Grpc) {
query: Query
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc.graphql
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion examples/jsonplaceholder.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "./.tailcallrc.schema.json",
"server": {
"graphiql": true,
"hostname": "0.0.0.0",
"port": 8000
},
Expand Down
1 change: 0 additions & 1 deletion examples/jsonplaceholder.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
server:
graphiql: true
hostname: 0.0.0.0
port: 8000
upstream:
Expand Down
2 changes: 1 addition & 1 deletion examples/jsonplaceholder_batch.graphql
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions examples/jsonplaceholder_batch.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"server": {
"port": 8000,
"graphiql": true
"port": 8000
},
"upstream": {
"baseURL": "http://jsonplaceholder.typicode.com",
Expand Down
1 change: 0 additions & 1 deletion examples/jsonplaceholder_batch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
server:
port: 8000
graphiql: true
upstream:
baseURL: http://jsonplaceholder.typicode.com
httpCache: true
Expand Down
2 changes: 1 addition & 1 deletion examples/jsonplaceholder_http_2.graphql
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Loading

1 comment on commit 97dc20f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 7.65ms 3.64ms 124.87ms 74.30%
Req/Sec 3.32k 262.38 3.86k 85.00%

396167 requests in 30.01s, 1.99GB read

Requests/sec: 13200.41

Transfer/sec: 67.75MB

Please sign in to comment.