-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defer integration tests #6007
Open
Geal
wants to merge
7
commits into
dev
Choose a base branch
from
geal/defer-integration-tests
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
defer integration tests #6007
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dc817d4
defer integration tests
Geal b40fc22
try to parse the multipart body
Geal edcb456
make the test pass
Geal 7b4a191
lint
Geal 57208f6
rename basic to core
Geal a90df96
Merge branch 'dev' into geal/defer-integration-tests
Geal 7a3d45a
test defer with the entity cache
Geal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This is an example test | ||
|
||
This file adds some context that will be displayed on test failure |
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,4 @@ | ||
override_subgraph_url: | ||
products: http://localhost:4005 | ||
include_subgraph_errors: | ||
all: true |
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,53 @@ | ||
{ | ||
"actions": [ | ||
{ | ||
"type": "Start", | ||
"schema_path": "./supergraph.graphql", | ||
"configuration_path": "./configuration.yaml", | ||
"subgraphs": { | ||
"accounts": { | ||
"requests": [ | ||
{ | ||
"request": { | ||
"body": { | ||
"query": "{me{name}}" | ||
} | ||
}, | ||
"response": { | ||
"body": { | ||
"data": { | ||
"me": { | ||
"name": "test" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"reviews": { | ||
"requests": [] | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Request", | ||
"headers": { | ||
"Accept": "multipart/mixed;deferSpec=20220824" | ||
}, | ||
"request": { | ||
"query": "{ me { name ... @defer { reviews { body } } } }" | ||
}, | ||
"expected_response": { | ||
"data": { | ||
"me": { | ||
"name": "Ada Lovelace" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Stop" | ||
} | ||
] | ||
} |
125 changes: 125 additions & 0 deletions
125
apollo-router/tests/samples/basic/defer/supergraph.graphql
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,125 @@ | ||
schema | ||
@link(url: "https://specs.apollo.dev/link/v1.0") | ||
@link(url: "https://specs.apollo.dev/inaccessible/v0.2", for: SECURITY) | ||
@link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
|
||
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ||
|
||
directive @tag( | ||
name: String! | ||
) repeatable on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION | SCHEMA | ||
|
||
directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE | ||
|
||
directive @join__field( | ||
graph: join__Graph | ||
requires: join__FieldSet | ||
provides: join__FieldSet | ||
type: String | ||
external: Boolean | ||
override: String | ||
usedOverridden: Boolean | ||
) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION | ||
|
||
directive @join__graph(name: String!, url: String!) on ENUM_VALUE | ||
|
||
directive @join__implements( | ||
graph: join__Graph! | ||
interface: String! | ||
) repeatable on OBJECT | INTERFACE | ||
|
||
directive @join__type( | ||
graph: join__Graph! | ||
key: join__FieldSet | ||
extension: Boolean! = false | ||
resolvable: Boolean! = true | ||
isInterfaceObject: Boolean! = false | ||
) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR | ||
|
||
directive @join__unionMember( | ||
graph: join__Graph! | ||
member: String! | ||
) repeatable on UNION | ||
|
||
directive @link( | ||
url: String | ||
as: String | ||
for: link__Purpose | ||
import: [link__Import] | ||
) repeatable on SCHEMA | ||
|
||
scalar join__FieldSet | ||
|
||
enum join__Graph { | ||
ACCOUNTS | ||
@join__graph(name: "accounts", url: "https://accounts.demo.starstuff.dev/") | ||
INVENTORY | ||
@join__graph( | ||
name: "inventory" | ||
url: "https://inventory.demo.starstuff.dev/" | ||
) | ||
PRODUCTS | ||
@join__graph(name: "products", url: "https://products.demo.starstuff.dev/") | ||
REVIEWS | ||
@join__graph(name: "reviews", url: "https://reviews.demo.starstuff.dev/") | ||
} | ||
|
||
scalar link__Import | ||
|
||
enum link__Purpose { | ||
SECURITY | ||
EXECUTION | ||
} | ||
|
||
type Mutation @join__type(graph: PRODUCTS) @join__type(graph: REVIEWS) { | ||
createProduct(upc: ID!, name: String): Product @join__field(graph: PRODUCTS) | ||
createReview(upc: ID!, id: ID!, body: String): Review | ||
@join__field(graph: REVIEWS) | ||
} | ||
|
||
type Product | ||
@join__type(graph: INVENTORY, key: "upc") | ||
@join__type(graph: PRODUCTS, key: "upc") | ||
@join__type(graph: REVIEWS, key: "upc") { | ||
inStock: Boolean | ||
@join__field(graph: INVENTORY) | ||
@tag(name: "private") | ||
@inaccessible | ||
name: String @join__field(graph: PRODUCTS) | ||
weight: Int @join__field(graph: INVENTORY, external: true) @join__field(graph: PRODUCTS) | ||
price: Int @join__field(graph: INVENTORY, external: true) @join__field(graph: PRODUCTS) | ||
reviews: [Review] @join__field(graph: REVIEWS) | ||
reviewsForAuthor(authorID: ID!): [Review] @join__field(graph: REVIEWS) | ||
shippingEstimate: Int @join__field(graph: INVENTORY, requires: "price weight") | ||
upc: String! | ||
} | ||
|
||
type Query | ||
@join__type(graph: ACCOUNTS) | ||
@join__type(graph: INVENTORY) | ||
@join__type(graph: PRODUCTS) | ||
@join__type(graph: REVIEWS) { | ||
me: User @join__field(graph: ACCOUNTS) | ||
topProducts(first: Int = 5): [Product] @join__field(graph: PRODUCTS) | ||
} | ||
|
||
type Review @join__type(graph: REVIEWS, key: "id") { | ||
id: ID! | ||
body: String @join__field(graph: REVIEWS) | ||
author: User @join__field(graph: REVIEWS, provides: "username") | ||
product: Product @join__field(graph: REVIEWS) | ||
} | ||
|
||
type User | ||
@join__type(graph: ACCOUNTS, key: "id") | ||
@join__type(graph: REVIEWS, key: "id") { | ||
id: ID! | ||
name: String @join__field(graph: ACCOUNTS) | ||
username: String | ||
@join__field(graph: ACCOUNTS) | ||
@join__field(graph: REVIEWS, external: true) | ||
reviews: [Review] @join__field(graph: REVIEWS) | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@BrynCooke do you remember why the integration tests were removing the
Accept
header from the request?