include alias even if we don't need it
This commit is contained in:
@@ -23,7 +23,7 @@ type getViewerResponse struct {
|
||||
}
|
||||
|
||||
type getViewerViewerUser struct {
|
||||
MyName string
|
||||
MyName string `json:"MyName"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -8,11 +8,11 @@ import (
|
||||
)
|
||||
|
||||
type QueryWithAliasResponse struct {
|
||||
User QueryWithAliasUser
|
||||
User QueryWithAliasUser `json:"User"`
|
||||
}
|
||||
|
||||
type QueryWithAliasUser struct {
|
||||
ID mypkg.ID
|
||||
ID mypkg.ID `json:"ID"`
|
||||
}
|
||||
|
||||
func QueryWithAlias(
|
||||
|
||||
@@ -12,8 +12,8 @@ type QueryWithDoubleAliasResponse struct {
|
||||
}
|
||||
|
||||
type QueryWithDoubleAliasUser struct {
|
||||
ID mypkg.ID
|
||||
AlsoID mypkg.ID
|
||||
ID mypkg.ID `json:"ID"`
|
||||
AlsoID mypkg.ID `json:"AlsoID"`
|
||||
}
|
||||
|
||||
func QueryWithDoubleAlias(
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ type UsesEnumTwiceQueryOtherUser struct {
|
||||
}
|
||||
|
||||
type UsesEnumTwiceQueryResponse struct {
|
||||
Me UsesEnumTwiceQueryMeUser
|
||||
OtherUser UsesEnumTwiceQueryOtherUser
|
||||
Me UsesEnumTwiceQueryMeUser `json:"Me"`
|
||||
OtherUser UsesEnumTwiceQueryOtherUser `json:"OtherUser"`
|
||||
}
|
||||
|
||||
func UsesEnumTwiceQuery(
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ func (builder *typeBuilder) writeField(field field) error {
|
||||
if builder.schema.Types[typ.Name()].IsAbstractType() {
|
||||
// abstract types are handled in our UnmarshalJSON
|
||||
builder.WriteString(" `json:\"-\"`")
|
||||
} else if jsonName != goName {
|
||||
} else {
|
||||
fmt.Fprintf(builder, " `json:\"%s\"`", jsonName)
|
||||
}
|
||||
builder.WriteRune('\n')
|
||||
|
||||
Reference in New Issue
Block a user