Skip to content

Commit

Permalink
update Node.js harness (#181)
Browse files Browse the repository at this point in the history
* update Node.js harness

* update environments

* regenerate test specs

* Fix Rule suffix

These should match the strings passed into AddRule()

* Update metadata for interface implements so covariance check works

* Adjust quoting and verbiage to match new test suite expectations

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* fixed to be starting indent from line 1

* regenerate test specs

* fixed UniqueVariableNames validator rule to add the same error only once

* fixed ValuesOfCorrectTypeRule test for #181

* fixed UniqueArgumentNames test for #181

* fixed SingleFieldSubscriptions tests for #181

* fixed deviations to ignore NoDeprecatedCustomRule because optional

* fixed deviations to ignore NoSchemaIntrospectionCustomRule because optional

* fixed KnownDirectives validation for #181

* fixed deviations.yml

* fixed FieldsOnCorrectType for #181

* fixed OverlappingFieldsCanBeMergedRule for #181

* fixed ProvidedRequiredArguments for #181

* fixed UniqueVariableNames validator rule to add the same error only once

* fixed UniqueArgumentNames test for #181

* fixed SingleFieldSubscriptions tests for #181

* fixed KnownDirectives validation for #181

* fixed FieldsOnCorrectType for #181

* fixed OverlappingFieldsCanBeMergedRule for #181

* fixed ProvidedRequiredArguments for #181

* fixed walk logic for directive

* fixed UniqueDirectivesPerLocation for repeatable

* fixed KnownTypeNames for #181

* fixed NoUndefinedVariables for #181

* upgrade go version

* fixed modules

* added interfaces.graphql for 14aecc0

Co-authored-by: vvakame <vvakame+dev@gmail.com>
Co-authored-by: Adam Scarr <ascarr@squareup.com>
Co-authored-by: Kei Kamikawa <code-hex@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 28, 2022
1 parent 25dc9ba commit f952228
Show file tree
Hide file tree
Showing 70 changed files with 6,606 additions and 6,252 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: golang:1.13
- image: golang:1.16
working_directory: /gqlparser
steps:
- checkout
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/vektah/gqlparser/v2

go 1.13
go 1.16

require (
github.com/agnivade/levenshtein v1.0.1
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
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
golang.org/x/tools v0.1.9
gopkg.in/yaml.v2 v2.2.4
)
33 changes: 28 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ github.com/agnivade/levenshtein v1.0.1 h1:3oJU7J3FGFmyhn8KHjmVaZCN5hxTr7GxgRue+s
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
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=
Expand All @@ -18,13 +17,37 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
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=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8=
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
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=
15 changes: 0 additions & 15 deletions validator/imported/.babelrc

This file was deleted.

7 changes: 7 additions & 0 deletions validator/imported/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": ["@babel/plugin-transform-typescript"],
"presets": [
"@babel/preset-env",
"@babel/preset-flow"
]
}
19 changes: 14 additions & 5 deletions validator/imported/deviations.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- rule: 'ExecutableDefinitions/.*'
- rule: 'ExecutableDefinitionsRule/.*'
skip: "These are impossible to generate because the parser is split between Query and Schema"

- rule: 'FieldsOnCorrectType/Defined on implementors but not on interface'
Expand All @@ -7,14 +7,23 @@
locations:
- {line: 3, column: 9}

- rule: 'KnownDirectives/within schema language/with misplaced directives'
- rule: 'KnownDirectivesRule/within schema language/with misplaced directives'
skip: "When the syntax of schema is mixed in query, parser can't consume schema syntax and ignore it"

- rule: 'KnownTypeNames/ignores type definitions'
- rule: 'KnownTypeNamesRule/ignores type definitions'
skip: "When the syntax of schema is mixed in query, parser can't consume schema syntax and ignore it"

- rule: 'OverlappingFieldsCanBeMerged/return types must be unambiguous/reports correctly when a non-exclusive follows an exclusive'
- rule: 'OverlappingFieldsCanBeMergedRule/return types must be unambiguous/reports correctly when a non-exclusive follows an exclusive'
skip: "Spec issue? scalar is not exists on SomeBox"

- rule: 'ValuesOfCorrectType/.*custom scalar.*'
- rule: 'ValuesOfCorrectTypeRule/.*custom scalar.*'
skip: "Custom scalars are a runtime feature, maybe they dont belong in here?"

- rule: 'NoDeprecatedCustomRule/.*'
skip: "This rule is optional and is not part of the Validation section of the GraphQL Specification"

- rule: 'NoSchemaIntrospectionCustomRule/.*'
skip: "This rule is optional and is not part of the Validation section of the GraphQL Specification"

- rule: 'KnownTypeNamesRule/references to standard scalars that are missing in schema'
skip: "standard scalars must be exists in schema"
Loading

0 comments on commit f952228

Please sign in to comment.