-
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:
@alias
Directive for Enum Field (#2969)
- Loading branch information
Showing
9 changed files
with
141 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"color": { | ||
"departments": [ | ||
"ENGINEERING", | ||
"MARKETING", | ||
"HR" | ||
] | ||
} | ||
} | ||
} | ||
} |
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,57 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatted | ||
--- | ||
scalar Bytes | ||
|
||
type DTA { | ||
departments: [Department] | ||
} | ||
|
||
scalar Date | ||
|
||
scalar DateTime | ||
|
||
enum Department { | ||
ENGINEERING | ||
HUMAN_RESOURCE | ||
MARKETING | ||
} | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
scalar Int128 | ||
|
||
scalar Int16 | ||
|
||
scalar Int32 | ||
|
||
scalar Int64 | ||
|
||
scalar Int8 | ||
|
||
scalar JSON | ||
|
||
scalar PhoneNumber | ||
|
||
type Query { | ||
color: DTA | ||
} | ||
|
||
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,21 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatter | ||
--- | ||
schema @server(batchRequests: true) @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { | ||
query: Query | ||
} | ||
|
||
enum Department { | ||
ENGINEERING | ||
HUMAN_RESOURCE @alias(options: ["HR"]) | ||
MARKETING | ||
} | ||
|
||
type DTA { | ||
departments: [Department] | ||
} | ||
|
||
type Query { | ||
color: DTA @expr(body: {departments: ["ENGINEERING", "MARKETING", "HR"]}) | ||
} |
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,32 @@ | ||
# test-alias-on-enum | ||
|
||
```graphql @config | ||
schema @server(batchRequests: true) @upstream(batch: {delay: 1, headers: [], maxSize: 100}) { | ||
query: Query | ||
} | ||
|
||
schema @server(enableJIT: false) { | ||
query: Query | ||
} | ||
|
||
enum Department { | ||
ENGINEERING | ||
MARKETING | ||
HUMAN_RESOURCE @alias(options: ["HR"]) | ||
} | ||
|
||
type Query { | ||
color: DTA @expr(body: {departments: ["ENGINEERING", "MARKETING", "HR"]}) | ||
} | ||
|
||
type DTA { | ||
departments: [Department] | ||
} | ||
``` | ||
|
||
```yml @test | ||
- method: POST | ||
url: http://localhost:8080/graphql | ||
body: | ||
query: "query { color { departments } }" | ||
``` |
0a431f9
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
431882 requests in 30.03s, 805.68MB read
Requests/sec: 14380.25
Transfer/sec: 26.83MB