Skip to content

Commit 3582a63

Browse files
authored
Merge branch 'master' into sogko/float64
2 parents c7fc493 + 4a8d417 commit 3582a63

File tree

11 files changed

+435
-188
lines changed

11 files changed

+435
-188
lines changed

gqlerrors/syntax.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package gqlerrors
33
import (
44
"fmt"
55
"regexp"
6+
"strings"
67

78
"github.com/graphql-go/graphql/language/ast"
89
"github.com/graphql-go/graphql/language/location"
910
"github.com/graphql-go/graphql/language/source"
10-
"strings"
1111
)
1212

1313
func NewSyntaxError(s *source.Source, position int, description string) *Error {
@@ -44,7 +44,7 @@ func highlightSourceAtLocation(s *source.Source, l location.SourceLocation) stri
4444
lineNum := fmt.Sprintf("%d", line)
4545
nextLineNum := fmt.Sprintf("%d", (line + 1))
4646
padLen := len(nextLineNum)
47-
lines := regexp.MustCompile("\r\n|[\n\r]").Split(s.Body, -1)
47+
lines := regexp.MustCompile("\r\n|[\n\r]").Split(string(s.Body), -1)
4848
var highlight string
4949
if line >= 2 {
5050
highlight += fmt.Sprintf("%s: %s\n", lpad(padLen, prevLineNum), printLine(lines[line-2]))

graphql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Params struct {
3434

3535
func Do(p Params) *Result {
3636
source := source.NewSource(&source.Source{
37-
Body: p.RequestString,
37+
Body: []byte(p.RequestString),
3838
Name: "GraphQL request",
3939
})
4040
AST, err := parser.Parse(parser.ParseParams{Source: source})

0 commit comments

Comments
 (0)