Skip to content

Commit ab449f0

Browse files
committed
use a string and not an Ident for a FieldDefinition's name
This was an error. When this field was renamed from schema.Field (to avoid ambiguity) its name field changed to match query.Field (to Ident). This caused a cascade of useless changes that will be rolled back in the next commit
1 parent 6537f29 commit ab449f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

types/field.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package types
44
//
55
// http://spec.graphql.org/draft/#FieldDefinition
66
type FieldDefinition struct {
7-
Name Ident
7+
Name string
88
Arguments ArgumentsDefinition
99
Type Type
1010
Directives DirectiveList
@@ -19,7 +19,7 @@ type FieldsDefinition []*FieldDefinition
1919
// Get returns a FieldDefinition in a FieldsDefinition by name or nil if not found.
2020
func (l FieldsDefinition) Get(name string) *FieldDefinition {
2121
for _, f := range l {
22-
if f.Name.Name == name {
22+
if f.Name == name {
2323
return f
2424
}
2525
}
@@ -30,7 +30,7 @@ func (l FieldsDefinition) Get(name string) *FieldDefinition {
3030
func (l FieldsDefinition) Names() []string {
3131
names := make([]string, len(l))
3232
for i, f := range l {
33-
names[i] = f.Name.Name
33+
names[i] = f.Name
3434
}
3535
return names
3636
}

0 commit comments

Comments
 (0)