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

Don't crash when interface resolver returns a typed nil #929

Merged
merged 4 commits into from
Nov 28, 2019

Commits on Nov 13, 2019

  1. Return graphql.Null in interface resolver when passed a typed nil

    Go's dreaded _typed nil_ strikes again. Nil pointers of struct types
    aren't equal to nil interface pointers.
    
    See https://golang.org/doc/faq#nil_error
    Nicolas Maquet committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    85ca9ef View commit details
    Browse the repository at this point in the history
  2. Regenerate examples

    Nicolas Maquet committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    201768f View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2019

  1. Add unit test for the interface resolver / typed nil interaction

    This added test shows that the `_Dog_species` automatically generated
    resolver will crash unless the extra nil check is added in
    `interface.gotpl`.
    Nicolas Maquet committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    5994608 View commit details
    Browse the repository at this point in the history
  2. Add a comment

    Nicolas Maquet committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    fcfe595 View commit details
    Browse the repository at this point in the history