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

Return clearer errors when __typename is missing #68

Merged
merged 1 commit into from
Aug 28, 2021

Conversation

benjaminjkraft
Copy link
Collaborator

Summary:

In practice, at Khan at least, this is easy to mess up when writing
mocks, because you write the mock by looking at the query, and the query
doesn't say it's asking for __typename (because genqlient
automatically adds that). A sufficiently-smart mocking library might be
able to fix that, or detect it at least, but in any case, we can give a
clearer error.

I also removed an unrelated TODO that was done.

Issue: https://khanacademy.slack.com/archives/C01120CNCS0/p1630019788014000

Test plan:

make check

In practice, at Khan at least, this is easy to mess up when writing
mocks, because you write the mock by looking at the query, and the query
doesn't say it's asking for `__typename` (because genqlient
automatically adds that).  A sufficiently-smart mocking library might be
able to fix that, or detect it at least, but in any case, we can give a
clearer error.

I also removed an unrelated TODO that was done.

Issue: https://khanacademy.slack.com/archives/C01120CNCS0/p1630019788014000

Test plan: make check

Reviewers: csilvers, marksandstrom, adam, miguel
Copy link
Contributor

@dnerdy dnerdy left a comment

Choose a reason for hiding this comment

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

Lgtm!

@benjaminjkraft benjaminjkraft merged commit 46898ca into main Aug 28, 2021
@benjaminjkraft benjaminjkraft deleted the benkraft.typename-error branch August 28, 2021 01:12
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