-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(link): add
meta
support (#2824)
- Loading branch information
Showing
10 changed files
with
145 additions
and
0 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
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
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
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
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
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
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
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,55 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatted | ||
--- | ||
scalar Bytes | ||
|
||
scalar Date | ||
|
||
scalar DateTime | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
scalar Int128 | ||
|
||
scalar Int16 | ||
|
||
scalar Int32 | ||
|
||
scalar Int64 | ||
|
||
scalar Int8 | ||
|
||
scalar JSON | ||
|
||
type News { | ||
id: Int | ||
} | ||
|
||
input NewsInput { | ||
id: Int | ||
} | ||
|
||
scalar PhoneNumber | ||
|
||
type Query { | ||
newsById(news: NewsInput!): News! | ||
} | ||
|
||
scalar UInt128 | ||
|
||
scalar UInt16 | ||
|
||
scalar UInt32 | ||
|
||
scalar UInt64 | ||
|
||
scalar UInt8 | ||
|
||
scalar Url | ||
|
||
schema { | ||
query: Query | ||
} |
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,26 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatter | ||
--- | ||
schema | ||
@server(port: 8000) | ||
@upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: [], maxSize: 1000}) | ||
@link(id: "news", src: "news.proto", meta: {description: "Test"}, type: Protobuf) { | ||
query: Query | ||
} | ||
|
||
input NewsInput { | ||
id: Int | ||
} | ||
|
||
type News { | ||
id: Int | ||
} | ||
|
||
type NewsData { | ||
news: [News] | ||
} | ||
|
||
type Query { | ||
newsById(news: NewsInput!): News! @grpc(body: "{{.args.news}}", method: "news.NewsService.GetNews") | ||
} |
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,50 @@ | ||
--- | ||
identity: true | ||
--- | ||
|
||
# test-link-support | ||
|
||
```protobuf @file:news.proto | ||
syntax = "proto3"; | ||
import "google/protobuf/empty.proto"; | ||
package news; | ||
message News { | ||
int32 id = 1; | ||
} | ||
service NewsService { | ||
rpc GetNews (NewsId) returns (News) {} | ||
} | ||
message NewsId { | ||
int32 id = 1; | ||
} | ||
``` | ||
|
||
```graphql @config | ||
schema | ||
@server(port: 8000) | ||
@upstream(baseURL: "http://localhost:50051", batch: {delay: 10, headers: [], maxSize: 1000}) | ||
@link(id: "news", src: "news.proto", meta: {description: "Test"}, type: Protobuf) { | ||
query: Query | ||
} | ||
|
||
input NewsInput { | ||
id: Int | ||
} | ||
|
||
type News { | ||
id: Int | ||
} | ||
|
||
type NewsData { | ||
news: [News] | ||
} | ||
|
||
type Query { | ||
newsById(news: NewsInput!): News! @grpc(body: "{{.args.news}}", method: "news.NewsService.GetNews") | ||
} | ||
``` |
3a8d1e8
There was a problem hiding this comment.
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
214241 requests in 30.02s, 1.07GB read
Requests/sec: 7136.82
Transfer/sec: 36.63MB