Skip to content
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

Fixed duplicated __typename in response (fixes #369) #443

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

eko
Copy link
Contributor

@eko eko commented Mar 29, 2021

This pull request fixes issue reported in #369

@eko eko force-pushed the fix-369 branch 3 times, most recently from c0e21b8 to b7dec52 Compare March 29, 2021 09:43
@@ -23,6 +23,7 @@ type Test struct {
Variables map[string]interface{}
ExpectedResult string
ExpectedErrors []*errors.QueryError
RawResponse bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice addition!

@pavelnikolov pavelnikolov merged commit 21b77bd into graph-gophers:master Mar 29, 2021
@pavelnikolov
Copy link
Member

Thank you for your contribution!

@eko
Copy link
Contributor Author

eko commented Mar 29, 2021

@pavelnikolov I take this opportunity: do you think you could make tags to have a better management of the releases?

@pavelnikolov
Copy link
Member

Yes, this is something I have been planing to do for some time. I expect to make it happen really soon. I'll also add a CHANGELOG.md file. Thank you for your patience.

@eko
Copy link
Contributor Author

eko commented Mar 29, 2021

Great, thanks!

}

want, err := formatJSON([]byte(test.ExpectedResult))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If raw response is used, do we need to leave the expected result raw as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eko ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because the RawResponse only acts on got variable (effective response), not on the want (expected result) specified: in unit tests you have to specify a raw (not formatted) expected response.

Maybe the formatJSON() is not necessary anymore and we could just json.Marshal()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants