-
Notifications
You must be signed in to change notification settings - Fork 238
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
8 changed files
with
195 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Showcase GraphQL Request | ||
|
||
#### server: | ||
|
||
```graphql | ||
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") | ||
} | ||
``` | ||
|
||
#### mock: | ||
|
||
```yml | ||
- request: | ||
method: GET | ||
url: http://jsonplaceholder.typicode.com/users/1 | ||
headers: | ||
test: test | ||
body: null | ||
response: | ||
status: 200 | ||
body: | ||
id: 1 | ||
name: foo | ||
- request: | ||
method: GET | ||
url: http://example.com/simple.graphql | ||
body: null | ||
response: | ||
status: 200 | ||
body: null | ||
- request: | ||
method: GET | ||
url: http://example.com/invalid.graphql | ||
body: null | ||
response: | ||
status: 200 | ||
body: dsjfsjdfjdsfjkdskjfjkds | ||
``` | ||
|
||
#### assert: | ||
|
||
```yml | ||
- method: POST | ||
url: http://localhost:8080/showcase/graphql?config=http%3A%2F%2Fexample.com%2Fsimple.graphql | ||
body: | ||
query: query { user { name } } | ||
- method: POST | ||
url: http://localhost:8080/showcase/graphql | ||
body: | ||
query: query { user { name } } | ||
- method: POST | ||
url: http://localhost:8080/showcase/graphql?config=.%2Ftests%2Fhttp%2Fconfig%2Fsimple.graphql | ||
body: | ||
query: query { user { name } } | ||
- method: POST | ||
url: http://localhost:8080/showcase/graphql?config=http%3A%2F%2Fexample.com%2Finvalid.graphql | ||
body: | ||
query: query { user { name } } | ||
- method: POST | ||
url: http://localhost:8080/showcase/graphql?config=http%3A%2F%2Fexample.com%2Fsimple.graphql | ||
body: | ||
query: | ||
foo: bar | ||
``` |
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,17 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"user": { | ||
"name": "foo" | ||
} | ||
} | ||
} | ||
} |
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,18 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "No Config URL specified" | ||
} | ||
] | ||
} | ||
} |
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,18 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "Invalid Config URL specified" | ||
} | ||
] | ||
} | ||
} |
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,18 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "Failed to read config: Validation Error\n• --> 1:1\n |\n1 | \"dsjfsjdfjdsfjkdskjfjkds\"\n | ^---\n |\n = expected type_system_definition\n" | ||
} | ||
] | ||
} | ||
} |
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,18 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "Unexpected GraphQL Request: invalid type: map, expected a string at line 1 column 9" | ||
} | ||
] | ||
} | ||
} |
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,16 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: client | ||
--- | ||
type Query { | ||
not_user: User | ||
} | ||
|
||
type User { | ||
not_id: Int | ||
not_name: String | ||
} | ||
|
||
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,16 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: merged | ||
--- | ||
schema @server(showcase: true) @upstream { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
not_user: User @http(baseURL: "http://jsonplaceholder.typicode.com", path: "/users/1") | ||
} | ||
|
||
type User { | ||
not_id: Int | ||
not_name: String | ||
} |