-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fork hydration tests * Fix duplicated test for new code
- Loading branch information
Showing
134 changed files
with
20,632 additions
and
2 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
224 changes: 224 additions & 0 deletions
224
...complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml
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,224 @@ | ||
name: "new complex identified by doesnt use all input fields in the inputIdentifiedBy argument" | ||
enabled: true | ||
overallSchema: | ||
Activity: | | ||
type Query { | ||
activities: [Activity] | ||
} | ||
type Activity { | ||
id: ID | ||
issue: Issue @hydrated( | ||
service: "Issue" | ||
field: "issues" | ||
arguments: [{name: "issuesInput" value: "$source.context.issueHydrationInput"}] | ||
inputIdentifiedBy: [ | ||
{sourceId: "context.issueHydrationInput.id" resultId: "issueId"} | ||
] | ||
) | ||
} | ||
Issue: | | ||
type Query { | ||
issues(issuesInput: IssueInput!): [Issue] | ||
} | ||
type Issue { | ||
issueId: ID | ||
description: String | ||
} | ||
input IssueInput { | ||
id: ID! | ||
site: ID! | ||
} | ||
underlyingSchema: | ||
Activity: | | ||
type Query { | ||
activities: [Activity] | ||
} | ||
type Activity { | ||
id: ID | ||
context: HydrationContext | ||
} | ||
type HydrationContext { | ||
issueHydrationInput: IssueHydrationInput | ||
} | ||
type IssueHydrationInput { | ||
id: ID! | ||
site: ID! | ||
} | ||
Issue: | | ||
type Query { | ||
issues(issuesInput: IssueInput!): [Issue] | ||
} | ||
type Issue { | ||
issueId: ID | ||
description: String | ||
} | ||
input IssueInput { | ||
id: ID! | ||
site: ID! | ||
} | ||
query: | | ||
query { | ||
activities { | ||
id | ||
issue { | ||
issueId | ||
description | ||
} | ||
} | ||
} | ||
variables: { } | ||
serviceCalls: | ||
- serviceName: "Activity" | ||
request: | ||
query: | | ||
{ | ||
activities { | ||
__typename__batch_hydration__issue: __typename | ||
batch_hydration__issue__context: context { | ||
issueHydrationInput { | ||
id | ||
} | ||
} | ||
batch_hydration__issue__context: context { | ||
issueHydrationInput { | ||
site | ||
} | ||
} | ||
id | ||
} | ||
} | ||
variables: { } | ||
# language=JSON | ||
response: |- | ||
{ | ||
"data": { | ||
"activities": [ | ||
{ | ||
"__typename__batch_hydration__issue": "Activity", | ||
"batch_hydration__issue__context": { | ||
"issueHydrationInput": { | ||
"id": "ISSUE-0", | ||
"site": "CLOUD-0" | ||
} | ||
}, | ||
"id": "ACTIVITY-0" | ||
}, | ||
{ | ||
"__typename__batch_hydration__issue": "Activity", | ||
"batch_hydration__issue__context": { | ||
"issueHydrationInput": { | ||
"id": "ISSUE-1", | ||
"site": "CLOUD-0" | ||
} | ||
}, | ||
"id": "ACTIVITY-1" | ||
}, | ||
{ | ||
"__typename__batch_hydration__issue": "Activity", | ||
"batch_hydration__issue__context": { | ||
"issueHydrationInput": { | ||
"id": "ISSUE-2", | ||
"site": "CLOUD-0" | ||
} | ||
}, | ||
"id": "ACTIVITY-2" | ||
}, | ||
{ | ||
"__typename__batch_hydration__issue": "Activity", | ||
"batch_hydration__issue__context": { | ||
"issueHydrationInput": { | ||
"id": "ISSUE-3", | ||
"site": "CLOUD-0" | ||
} | ||
}, | ||
"id": "ACTIVITY-3" | ||
} | ||
] | ||
}, | ||
"extensions": {} | ||
} | ||
- serviceName: "Issue" | ||
request: | ||
query: | | ||
{ | ||
issues(issuesInput: [{id : "ISSUE-0", site : "CLOUD-0"}, {id : "ISSUE-1", site : "CLOUD-0"}, {id : "ISSUE-2", site : "CLOUD-0"}, {id : "ISSUE-3", site : "CLOUD-0"}]) { | ||
description | ||
issueId | ||
batch_hydration__issue__issueId: issueId | ||
} | ||
} | ||
variables: { } | ||
# language=JSON | ||
response: |- | ||
{ | ||
"data": { | ||
"issues": [ | ||
{ | ||
"batch_hydration__issue__issueId": "ISSUE-0", | ||
"issueId": "ISSUE-0", | ||
"description": "fix A" | ||
}, | ||
{ | ||
"batch_hydration__issue__issueId": "ISSUE-1", | ||
"issueId": "ISSUE-1", | ||
"description": "fix B" | ||
}, | ||
{ | ||
"batch_hydration__issue__issueId": "ISSUE-2", | ||
"issueId": "ISSUE-2", | ||
"description": "fix C" | ||
}, | ||
{ | ||
"batch_hydration__issue__issueId": "ISSUE-3", | ||
"issueId": "ISSUE-3", | ||
"description": "fix D" | ||
} | ||
] | ||
}, | ||
"extensions": {} | ||
} | ||
# language=JSON | ||
response: |- | ||
{ | ||
"data": { | ||
"activities": [ | ||
{ | ||
"id": "ACTIVITY-0", | ||
"issue": { | ||
"issueId": "ISSUE-0", | ||
"description": "fix A" | ||
} | ||
}, | ||
{ | ||
"id": "ACTIVITY-1", | ||
"issue": { | ||
"issueId": "ISSUE-1", | ||
"description": "fix B" | ||
} | ||
}, | ||
{ | ||
"id": "ACTIVITY-2", | ||
"issue": { | ||
"issueId": "ISSUE-2", | ||
"description": "fix C" | ||
} | ||
}, | ||
{ | ||
"id": "ACTIVITY-3", | ||
"issue": { | ||
"issueId": "ISSUE-3", | ||
"description": "fix D" | ||
} | ||
} | ||
] | ||
}, | ||
"errors": [] | ||
} |
107 changes: 107 additions & 0 deletions
107
...complex identified by/new-complex-identified-by-hydration-batching-returns-null-batch.yml
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,107 @@ | ||
name: "new complex identified by hydration batching returns null batch" | ||
enabled: true | ||
overallSchema: | ||
service2: | | ||
type Query { | ||
barsById(id: [ID]): [Bar] | ||
} | ||
type Bar { | ||
id: ID | ||
name: String | ||
} | ||
service1: | | ||
type Query { | ||
foo: Foo | ||
} | ||
type Foo { | ||
id: ID | ||
bar: [Bar] @hydrated( | ||
service: "service2" | ||
field: "barsById" | ||
arguments: [{name: "id" value: "$source.barId"}] | ||
inputIdentifiedBy: [{sourceId: "barId" resultId: "id"}] | ||
) | ||
} | ||
underlyingSchema: | ||
service2: | | ||
type Bar { | ||
id: ID | ||
name: String | ||
} | ||
type Query { | ||
barsById(id: [ID]): [Bar] | ||
} | ||
service1: | | ||
type Foo { | ||
barId: [ID] | ||
id: ID | ||
} | ||
type Query { | ||
foo: Foo | ||
} | ||
query: | | ||
query { | ||
foo { | ||
bar { | ||
name | ||
} | ||
} | ||
} | ||
variables: { } | ||
serviceCalls: | ||
- serviceName: "service1" | ||
request: | ||
query: | | ||
query { | ||
foo { | ||
__typename__batch_hydration__bar: __typename | ||
batch_hydration__bar__barId: barId | ||
} | ||
} | ||
variables: { } | ||
# language=JSON | ||
response: |- | ||
{ | ||
"data": { | ||
"foo": { | ||
"__typename__batch_hydration__bar": "Foo", | ||
"batch_hydration__bar__barId": [ | ||
"barId1", | ||
"barId2", | ||
"barId3" | ||
] | ||
} | ||
}, | ||
"extensions": {} | ||
} | ||
- serviceName: "service2" | ||
request: | ||
query: | | ||
query { | ||
barsById(id: ["barId1", "barId2", "barId3"]) { | ||
batch_hydration__bar__id: id | ||
name | ||
} | ||
} | ||
variables: { } | ||
# language=JSON | ||
response: |- | ||
{ | ||
"extensions": {} | ||
} | ||
# language=JSON | ||
response: |- | ||
{ | ||
"data": { | ||
"foo": { | ||
"bar": [ | ||
null, | ||
null, | ||
null | ||
] | ||
} | ||
}, | ||
"extensions": {} | ||
} |
Oops, something went wrong.