Skip to content

Commit

Permalink
update package path to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
vektah committed Feb 16, 2020
1 parent f5ceb57 commit b778db6
Show file tree
Hide file tree
Showing 55 changed files with 130 additions and 116 deletions.
4 changes: 2 additions & 2 deletions ast/document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

. "github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/parser"
. "github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/parser"
)

func TestQueryDocMethods(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions formatter/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"strings"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/v2/ast"
)

type Formatter interface {
Expand Down Expand Up @@ -524,7 +524,7 @@ func (f *formatter) FormatVariableDefinition(def *ast.VariableDefinition) {
f.FormatValue(def.DefaultValue)
}

// TODO https://github.com/vektah/gqlparser/issues/102
// TODO https://github.com/vektah/gqlparser/v2/issues/102
// VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
}

Expand Down
8 changes: 4 additions & 4 deletions formatter/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"unicode/utf8"

"github.com/stretchr/testify/assert"
"github.com/vektah/gqlparser"
"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/formatter"
"github.com/vektah/gqlparser/parser"
"github.com/vektah/gqlparser/v2"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/formatter"
"github.com/vektah/gqlparser/v2/parser"
)

var update = flag.Bool("u", false, "update golden files")
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/vektah/gqlparser
module github.com/vektah/gqlparser/v2

go 1.12

require (
github.com/agnivade/levenshtein v1.0.1
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
github.com/sergi/go-diff v1.0.0 // indirect
github.com/stretchr/testify v1.3.0
github.com/sergi/go-diff v1.1.0 // indirect
github.com/stretchr/testify v1.4.0
golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6
gopkg.in/yaml.v2 v2.2.2
gopkg.in/yaml.v2 v2.2.4
)
14 changes: 14 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,30 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNg
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/vektah/gqlparser/v2 v1.3.1 h1:8b0IcD3qZKWJQHSzynbDlrtP3IxVydZ2DZepCGofqfU=
github.com/vektah/gqlparser/v2 v1.3.1/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74=
golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6 h1:iZgcI2DDp6zW5v9Z/5+f0NuqoxNdmzg4hivjk2WLXpY=
golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion gqlerror/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strconv"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/v2/ast"
)

// Error is the standard graphql error type described in https://facebook.github.io/graphql/draft/#sec-Errors
Expand Down
2 changes: 1 addition & 1 deletion gqlerror/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/v2/ast"
)

func TestErrorFormatting(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions gqlparser.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package gqlparser

import (
"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/parser"
"github.com/vektah/gqlparser/validator"
_ "github.com/vektah/gqlparser/validator/rules"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/gqlerror"
"github.com/vektah/gqlparser/v2/parser"
"github.com/vektah/gqlparser/v2/validator"
_ "github.com/vektah/gqlparser/v2/validator/rules"
)

func LoadSchema(str ...*ast.Source) (*ast.Schema, *gqlerror.Error) {
Expand Down
4 changes: 2 additions & 2 deletions lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"unicode/utf8"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/gqlerror"
)

// Lexer turns graphql request and schema strings into tokens
Expand Down
4 changes: 2 additions & 2 deletions lexer/lexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package lexer
import (
"testing"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/parser/testrunner"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/parser/testrunner"
)

func TestLexer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lexer/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package lexer
import (
"strconv"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/v2/ast"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package parser
import (
"strconv"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/lexer"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/gqlerror"
"github.com/vektah/gqlparser/v2/lexer"
)

type parser struct {
Expand Down
4 changes: 2 additions & 2 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/lexer"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/lexer"
)

func TestParserUtils(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions parser/query.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package parser

import (
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/lexer"
"github.com/vektah/gqlparser/v2/gqlerror"
"github.com/vektah/gqlparser/v2/lexer"

. "github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/v2/ast"
)

func ParseQuery(source *Source) (*QueryDocument, *gqlerror.Error) {
Expand Down
4 changes: 2 additions & 2 deletions parser/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser
import (
"testing"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/parser/testrunner"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/parser/testrunner"
)

func TestQueryDocument(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions parser/schema.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package parser

import (
. "github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/lexer"
. "github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/gqlerror"
"github.com/vektah/gqlparser/v2/lexer"
)

func ParseSchema(source *Source) (*SchemaDocument, *gqlerror.Error) {
Expand Down
4 changes: 2 additions & 2 deletions parser/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser
import (
"testing"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/parser/testrunner"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/parser/testrunner"
)

func TestSchemaDocument(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion parser/testrunner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/andreyvit/diff"
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/v2/gqlerror"
"gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gqlparser [![CircleCI](https://badgen.net/circleci/github/vektah/gqlparser/master)](https://circleci.com/gh/vektah/gqlparser) [![Go Report Card](https://goreportcard.com/badge/github.com/vektah/gqlparser)](https://goreportcard.com/report/github.com/vektah/gqlparser) [![Coverage Status](https://badgen.net/coveralls/c/github/vektah/gqlparser)](https://coveralls.io/github/vektah/gqlparser?branch=master)
gqlparser [![CircleCI](https://badgen.net/circleci/github/vektah/gqlparser/master)](https://circleci.com/gh/vektah/gqlparser) [![Go Report Card](https://goreportcard.com/badge/github.com/vektah/gqlparser/v2)](https://goreportcard.com/report/github.com/vektah/gqlparser/v2) [![Coverage Status](https://badgen.net/coveralls/c/github/vektah/gqlparser)](https://coveralls.io/github/vektah/gqlparser?branch=master)
===

This is a parser for graphql, written to mirror the graphql-js reference implementation as closely while remaining idiomatic and easy to use.
Expand Down
4 changes: 2 additions & 2 deletions validator/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package validator
import (
"fmt"

"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/gqlerror"
)

type ErrorOption func(err *gqlerror.Error)
Expand Down
6 changes: 3 additions & 3 deletions validator/imported_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/vektah/gqlparser"
"github.com/vektah/gqlparser/ast"
"github.com/vektah/gqlparser/gqlerror"
"github.com/vektah/gqlparser/v2"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/gqlerror"
"gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion validator/prelude.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package validator

import "github.com/vektah/gqlparser/ast"
import "github.com/vektah/gqlparser/v2/ast"

var Prelude = &ast.Source{
Name: "prelude.graphql",
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/fields_on_correct_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"sort"

"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/fragments_on_composite_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package validator
import (
"fmt"

"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/known_argument_names.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/known_directives.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/known_fragment_names.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/known_type_names.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/lone_anonymous_operation.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/no_fragment_cycles.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/no_undefined_variables.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/no_unused_fragments.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions validator/rules/no_unused_variables.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package validator

import (
"github.com/vektah/gqlparser/ast"
. "github.com/vektah/gqlparser/validator"
"github.com/vektah/gqlparser/v2/ast"
. "github.com/vektah/gqlparser/v2/validator"
)

func init() {
Expand Down
Loading

0 comments on commit b778db6

Please sign in to comment.