diff options
Diffstat (limited to 'vendor/github.com/graphql-go/graphql/located.go')
-rw-r--r-- | vendor/github.com/graphql-go/graphql/located.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/vendor/github.com/graphql-go/graphql/located.go b/vendor/github.com/graphql-go/graphql/located.go deleted file mode 100644 index 6ed8ec83..00000000 --- a/vendor/github.com/graphql-go/graphql/located.go +++ /dev/null @@ -1,37 +0,0 @@ -package graphql - -import ( - "errors" - "github.com/graphql-go/graphql/gqlerrors" - "github.com/graphql-go/graphql/language/ast" -) - -func NewLocatedError(err interface{}, nodes []ast.Node) *gqlerrors.Error { - var origError error - message := "An unknown error occurred." - if err, ok := err.(error); ok { - message = err.Error() - origError = err - } - if err, ok := err.(string); ok { - message = err - origError = errors.New(err) - } - stack := message - return gqlerrors.NewError( - message, - nodes, - stack, - nil, - []int{}, - origError, - ) -} - -func FieldASTsToNodeASTs(fieldASTs []*ast.Field) []ast.Node { - nodes := []ast.Node{} - for _, fieldAST := range fieldASTs { - nodes = append(nodes, fieldAST) - } - return nodes -} |