-
Notifications
You must be signed in to change notification settings - Fork 285
Fixing bug with only __typename in the selection set #1525
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
Conversation
src/Service.Tests/SqlTests/GraphQLQueryTests/GraphQLQueryTestBase.cs
Outdated
Show resolved
Hide resolved
Aniruddh25
left a comment
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.
Waiting for few answers, perhaps the optimization of not hitting the db can be a followup PR
I would have expected that to be the better approach, since you don't actually need any data back from the DB, but I can see there being a problem when you've done a query like: query {
books {
items {
__typename
}
}
}That should return a |
src/Service.Tests/SqlTests/GraphQLQueryTests/GraphQLQueryTestBase.cs
Outdated
Show resolved
Hide resolved
Aniruddh25
left a comment
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.
LGTM after 1 optimization to generate expected output
Aniruddh25
left a comment
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.
LGTM. Thanks for addressing all comments.
ayush3797
left a comment
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.
LGTM!
Why make this change?
{ book_by_pk(id: 1){ __typename } }What is this change?
SqlQueryStructure, if it is observed that there are no columns selected, then one of the primary keys is added so that the eventual database query constructed contains a valid column name in the SELECT statement.How was this tested?