-
Notifications
You must be signed in to change notification settings - Fork 121
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
fix(ferry): Fix problem with operationRequest generated on initial request being included in response each time. #545
Conversation
…quest being included in response each time.
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.
In this pull request, I changed my test code because the Request type generated at the time of the request and the Requst type in the response were different.
The following is a log of the failure.
There seems to be a difference in the contents of the DocumentNode.
It can be confirmed from the log that the DocumentNode included in the Response contains a typename.
failure test result
dart:async _CustomZone.runUnary
Expected: should do the following in order:
• emit an event that <Instance of ‘OperationResponse<GHumanWithArgsData, GHumanWithArgsVars>’> with data
: _$GHumanWithArgsData:<GHumanWithArgsData {
G__typename=Query,
human=GHumanWithArgsData_human {
G__typename=Human,
id=1,
name=Luke,
friendsConnection=GHumanWithArgsData_human_friendsConnection {
G__typename=FriendsConnection,
},
},
}> and linkException
: null and errors
: null and source
: DataSource:<DataSource.Link> and request
: _$GHumanWithArgsReq:<GHumanWithArgsReq {
vars=GHumanWithArgsVars {
id=1,
},
operation=Operation(document: DocumentNode(“query HumanWithArgs($id: ID!, $friendsAfter: ID) {\n human(id: $id) {\n id\n name\n height\n friendsConnection(first: 10, after: $friendsAfter) {\n friends {\n id\n name\n }\n }\n }\n}“), operationName: HumanWithArgs),
executeOnListen=true,
}>
• emit an event that <Instance of ‘OperationResponse<GHumanWithArgsData?, GHumanWithArgsVars>’> with data
: null and linkException
: null and errors
: null and source
: DataSource:<DataSource.Cache> and request
: _$GHumanWithArgsReq:<GHumanWithArgsReq {
vars=GHumanWithArgsVars {
id=1,
},
operation=Operation(document: DocumentNode(“query HumanWithArgs($id: ID!, $friendsAfter: ID) {\n human(id: $id) {\n id\n name\n height\n friendsConnection(first: 10, after: $friendsAfter) {\n friends {\n id\n name\n }\n }\n }\n}“), operationName: HumanWithArgs),
executeOnListen=true,
}>
• be done
Actual: <Instance of ‘_BoundSinkStream<dynamic, OperationResponse<GHumanWithArgsData, GHumanWithArgsVars>>’>
Which: emitted • Instance of ‘OperationResponse<GHumanWithArgsData, GHumanWithArgsVars>’
which didn’t emit an event that <Instance of ‘OperationResponse<GHumanWithArgsData, GHumanWithArgsVars>’> with data
: _$GHumanWithArgsData:<GHumanWithArgsData {
G__typename=Query,
human=GHumanWithArgsData_human {
G__typename=Human,
id=1,
name=Luke,
friendsConnection=GHumanWithArgsData_human_friendsConnection {
G__typename=FriendsConnection,
},
},
}> and linkException
: null and errors
: null and source
: DataSource:<DataSource.Link> and request
: _$GHumanWithArgsReq:<GHumanWithArgsReq {
vars=GHumanWithArgsVars {
id=1,
},
operation=Operation(document: DocumentNode(“query HumanWithArgs($id: ID!, $friendsAfter: ID) {\n human(id: $id) {\n id\n name\n height\n friendsConnection(first: 10, after: $friendsAfter) {\n friends {\n id\n name\n }\n }\n }\n}“), operationName: HumanWithArgs),
executeOnListen=true,
}>
because it emitted an event that has request
with value _$GHumanWithArgsReq:<GHumanWithArgsReq {
vars=GHumanWithArgsVars {
id=1,
},
operation=Operation(document: DocumentNode(“query HumanWithArgs($id: ID!, $friendsAfter: ID) {\n __typename\n human(id: $id) {\n __typename\n id\n name\n height\n friendsConnection(first: 10, after: $friendsAfter) {\n __typename\n friends {\n __typename\n id\n name\n }\n }\n }\n}“), operationName: HumanWithArgs),
executeOnListen=true,
}>
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.
Sorry, some explanations were missing.
The DocumentNode in the Response contains __typename, but the DocumentNode in the Request does not seem to contain __typename.
thanks for your contribution! i will add this as breaking change, as some users might rely on identity-equals between to sent and received request. |
@knaeckeKami |
This pull request fix #546 issue.