Skip to content

Commit

Permalink
use a string and not an Ident for a FieldDefinition's name
Browse files Browse the repository at this point in the history
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
  • Loading branch information
seansorr committed Mar 30, 2021
1 parent 6537f29 commit ab449f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions types/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package types
//
// http://spec.graphql.org/draft/#FieldDefinition
type FieldDefinition struct {
Name Ident
Name string
Arguments ArgumentsDefinition
Type Type
Directives DirectiveList
Expand All @@ -19,7 +19,7 @@ type FieldsDefinition []*FieldDefinition
// Get returns a FieldDefinition in a FieldsDefinition by name or nil if not found.
func (l FieldsDefinition) Get(name string) *FieldDefinition {
for _, f := range l {
if f.Name.Name == name {
if f.Name == name {
return f
}
}
Expand All @@ -30,7 +30,7 @@ func (l FieldsDefinition) Get(name string) *FieldDefinition {
func (l FieldsDefinition) Names() []string {
names := make([]string, len(l))
for i, f := range l {
names[i] = f.Name.Name
names[i] = f.Name
}
return names
}

0 comments on commit ab449f0

Please sign in to comment.