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/graphql/introspection/type.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'vendor/github.com/99designs/gqlgen/graphql/introspection/type.go') diff --git a/vendor/github.com/99designs/gqlgen/graphql/introspection/type.go b/vendor/github.com/99designs/gqlgen/graphql/introspection/type.go index b963aa0e..f1228edf 100644 --- a/vendor/github.com/99designs/gqlgen/graphql/introspection/type.go +++ b/vendor/github.com/99designs/gqlgen/graphql/introspection/type.go @@ -62,9 +62,9 @@ func (t *Type) Description() string { func (t *Type) Fields(includeDeprecated bool) []Field { if t.def == nil || (t.def.Kind != ast.Object && t.def.Kind != ast.Interface) { - return nil + return []Field{} } - var fields []Field + fields := []Field{} for _, f := range t.def.Fields { if strings.HasPrefix(f.Name, "__") { continue @@ -93,10 +93,10 @@ func (t *Type) Fields(includeDeprecated bool) []Field { func (t *Type) InputFields() []InputValue { if t.def == nil || t.def.Kind != ast.InputObject { - return nil + return []InputValue{} } - var res []InputValue + res := []InputValue{} for _, f := range t.def.Fields { res = append(res, InputValue{ Name: f.Name, @@ -118,10 +118,10 @@ func defaultValue(value *ast.Value) *string { func (t *Type) Interfaces() []Type { if t.def == nil || t.def.Kind != ast.Object { - return nil + return []Type{} } - var res []Type + res := []Type{} for _, intf := range t.def.Interfaces { res = append(res, *WrapTypeFromDef(t.schema, t.schema.Types[intf])) } @@ -131,10 +131,10 @@ func (t *Type) Interfaces() []Type { func (t *Type) PossibleTypes() []Type { if t.def == nil || (t.def.Kind != ast.Interface && t.def.Kind != ast.Union) { - return nil + return []Type{} } - var res []Type + res := []Type{} for _, pt := range t.schema.GetPossibleTypes(t.def) { res = append(res, *WrapTypeFromDef(t.schema, pt)) } @@ -143,10 +143,10 @@ func (t *Type) PossibleTypes() []Type { func (t *Type) EnumValues(includeDeprecated bool) []EnumValue { if t.def == nil || t.def.Kind != ast.Enum { - return nil + return []EnumValue{} } - var res []EnumValue + res := []EnumValue{} for _, val := range t.def.EnumValues { res = append(res, EnumValue{ Name: val.Name, -- cgit