Skip to content

Commit

Permalink
Add test case for aliased field
Browse files Browse the repository at this point in the history
  • Loading branch information
yamitzky committed Apr 9, 2018
1 parent 78f3a56 commit ba2ecb1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions example/starwars/starwars_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,20 @@ func TestStarwars(t *testing.T) {
var resp interface{}
c.MustPost(introspection.Query, &resp)
})

t.Run("aliased field and non-aliased field", func(t *testing.T) {
var resp struct {
Character struct {
Name string
}
AliasedCharacter struct {
Name string
}
}
c.MustPost(`{
character(id: 2001) { name }
aliasedCharacter: character(id: 2001) { name }
}`, &resp)
require.Equal(t, resp.Character, resp.AliasedCharacter)
})
}

0 comments on commit ba2ecb1

Please sign in to comment.