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