Skip to content

Commit

Permalink
supported INPUT_OBJECT directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Hex committed Apr 30, 2021
1 parent 5ad012e commit 1efc152
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion codegen/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func (b *builder) bindField(obj *Object, f *Field) (errret error) {
if err != nil {
errret = err
}
for _, dir := range obj.Directives {
if dir.IsLocation(ast.LocationInputObject) {
dirs = append(dirs, dir)
}
}
f.Directives = append(dirs, f.Directives...)
}
}()
Expand Down Expand Up @@ -420,7 +425,8 @@ func (f *Field) ImplDirectives() []*Directive {
loc = ast.LocationInputFieldDefinition
}
for i := range f.Directives {
if !f.Directives[i].Builtin && f.Directives[i].IsLocation(loc, ast.LocationObject) {
if !f.Directives[i].Builtin &&
(f.Directives[i].IsLocation(loc, ast.LocationObject) || f.Directives[i].IsLocation(loc, ast.LocationInputObject)) {
d = append(d, f.Directives[i])
}
}
Expand Down

0 comments on commit 1efc152

Please sign in to comment.