From 26b5343e2160de172969e6834074cf8482ceb845 Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Tue, 9 Apr 2019 21:45:24 +0200 Subject: Update Gopkg.* --- .../99designs/gqlgen/codegen/directive_build.go | 48 ---------------------- 1 file changed, 48 deletions(-) delete mode 100644 vendor/github.com/99designs/gqlgen/codegen/directive_build.go (limited to 'vendor/github.com/99designs/gqlgen/codegen/directive_build.go') diff --git a/vendor/github.com/99designs/gqlgen/codegen/directive_build.go b/vendor/github.com/99designs/gqlgen/codegen/directive_build.go deleted file mode 100644 index af77dc44..00000000 --- a/vendor/github.com/99designs/gqlgen/codegen/directive_build.go +++ /dev/null @@ -1,48 +0,0 @@ -package codegen - -import ( - "sort" - - "github.com/pkg/errors" -) - -func (cfg *Config) buildDirectives(types NamedTypes) ([]*Directive, error) { - var directives []*Directive - - for name, dir := range cfg.schema.Directives { - if name == "skip" || name == "include" || name == "deprecated" { - continue - } - - var args []FieldArgument - for _, arg := range dir.Arguments { - newArg := FieldArgument{ - GQLName: arg.Name, - Type: types.getType(arg.Type), - GoVarName: sanitizeArgName(arg.Name), - } - - if !newArg.Type.IsInput && !newArg.Type.IsScalar { - return nil, errors.Errorf("%s cannot be used as argument of directive %s(%s) only input and scalar types are allowed", arg.Type, dir.Name, arg.Name) - } - - if arg.DefaultValue != nil { - var err error - newArg.Default, err = arg.DefaultValue.Value(nil) - if err != nil { - return nil, errors.Errorf("default value for directive argument %s(%s) is not valid: %s", dir.Name, arg.Name, err.Error()) - } - } - args = append(args, newArg) - } - - directives = append(directives, &Directive{ - Name: name, - Args: args, - }) - } - - sort.Slice(directives, func(i, j int) bool { return directives[i].Name < directives[j].Name }) - - return directives, nil -} -- cgit