Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase on latest #1

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open

Rebase on latest #1

wants to merge 99 commits into from

Conversation

andrejgou
Copy link

No description provided.

danielnovograd and others added 30 commits April 30, 2021 10:54
The `VariablesInAllowedPosition` rule mutates the provided *ast.Value
which causes future validation to fails as well as altering the result
of the introspect query in gqlgen.
"VariablesInAllowedPosition" rule updates "value.ExpectedType.NonNull = false",
resulting in "ProvidedRequiredArguments" rule to have "argDef.Type.NonNull" changed on the next call.
Both ast.Value.ExpectedType and ast.VariableDefinition.Type are the pointers,
and it is easy to update values by accidence.

Therefore creating a copy, so changes in one validation rule (E.g. VariablesInAllowedPosition)
would not affect the behavior of the other rule (ProvidedRequiredArguments).

Not doing deep copy, so change should not have a big impact for memory or CPU even for large GraphQL applications.

Testing private methods, to not be confused by complex golang syntax.
(those are pure functions, so in case testing package is changed – refactoring should not be hard)
Update prelude to match graphql_spec for @deprecated directive
Stop validator mutating the provided *Schema
Conflicts:
	validator/validator_test.go - include both tests
It was possible to fix the single cause,
or to prevent accidental changes in future functions.

Assuming tests would cover future changes,
so removing additional check (that could in theory impact performance).
Also include specifiedBy in __Type
docs: Fix a few typos in the README
feat: do not mark __typename field as unknown in the schema validation
…rison

Fix: argument comparison between two sets of args
Fix for update by reference of default variable values
Signed-off-by: Steve Coffman <steve@khanacademy.org>
fredzqm and others added 30 commits June 10, 2023 11:18
* validate enum values directive is legit

* Add tests
Signed-off-by: Steve Coffman <steve@khanacademy.org>
* feat(lexer): return comment tokens

* fix(testrunner): fix error comparison in testrunner

* test(lexer): add position test for comments

* test(parser): add position tests

* feat(parser): skip comments in parsing
* feat(ast): add comment fields

* feat(formatter): implement getComment

* feat(parser): store comments in parser

* feat(ast): add Comment field for Definition

* feat(ast): implement Dumper interface for CommentGroup

* feat(parser): add comment support for schema parsing

* fix(parser): add comments to schema extensions

* test(formatter): add comments for schema test

* fix(ast,parser): treat multiline comments

* feat(formatter): format schema comments

* test(formatter): update golden

* feat(parser): implement comment parsing

* test(formatter): add query comment tests

* refactor(formatter): remove unused function

* refactor(parser): use dot import

* refactor(ast): remove unused methods

* fix: support comments before and after description

* test(parser): add test case with comments and descriptions

* fix: fix lost of comments after desription

* test(formatter): add description to scalar test case

* fix(parser): remove empty line
* fix: treat end of definition comments

* feat(formatter): emit end of definition comments

* feat(parser): treat end of file comment

* feat: add EndOfDefinitionComment to SchemaDefinition

* fix(formatter): treat schema description and comments

* feat(formatter): support end of file comments
…k.json to reduce vulnerabilities (#267)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SEMVER-3247795

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](npm/node-semver@v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…faults (#270)

Signed-off-by: Steve Coffman <steve@khanacademy.org>
* Put comments behind an option in formatter

In #263, we introduced parsing of comments, as well as support for them
in the formatter. In some cases this is surely useful, but in others
it's just bloat. (And as I describe in Khan/genqlient#282, it may even
be a problem in some cases which depended on the fact that formatting
the query didn't include comments.)

In this commit I introduce an option to control whether comments are
formatted. I set the default to false (i.e. restoring the previous
behavior if no options are set), because adding this felt to me
like a breaking change, and because it seems to me like the more common
usage. `WithComments()` restores the behavior added in #263. If others
disagree I'm happy to keep the changed default, and instead provide
`WithoutComments()`. I also added tests both ways (and for the existing
`WithIndent()` option), and checked that the `comments` tests match the
existing ones, and the `default` tests match those from `v2.6.3` (except
for the addition of a few descriptions whose omission seem to have been
a bug).

Comments are still parsed in any case, as adding new struct fields is no
problem; and they are still included in `Dump` since that seems
obviously parallel to struct fields and is more of a debugging thing.

* docs
Signed-off-by: Steve Coffman <steve@khanacademy.org>
* Add WrapIfUnwrapped

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

* Lint fixes

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

---------

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

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

* Update versions

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

---------

Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
* make *gqlerror.Error err public

* Update error.go
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Co-authored-by: Jan Zombik <jan.m.zombik@gmail.com>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2.
- [Release notes](https://github.com/chaijs/get-func-name/releases)
- [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2)

---
updated-dependencies:
- dependency-name: get-func-name
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.6 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Go 1.20 has added a new Unwrap method for error values
holding multiple errors. Implement this method as that
errors.Is/As work as expected.
Co-authored-by: Roman A. Grigorovich <ragrigorov@mts.ru>
* Redo github actions

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

* Update golangci-lint to match gqlgen

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

* Linter fixes

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

---------

Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Bumps the actions-deps group with 1 update: [github.com/stretchr/testify](https://github.com/stretchr/testify).


Updates `github.com/stretchr/testify` from 1.4.0 to 1.9.0
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.4.0...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the actions-deps group in /validator/imported with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [@babel/cli](https://github.com/babel/babel/tree/HEAD/packages/babel-cli) | `7.16.8` | `7.24.5` |
| [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `7.16.12` | `7.24.5` |
| [@babel/node](https://github.com/babel/babel/tree/HEAD/packages/babel-node) | `7.16.8` | `7.23.9` |
| [@babel/plugin-transform-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-typescript) | `7.16.8` | `7.24.5` |
| [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) | `7.22.6` | `7.24.5` |
| [@babel/preset-flow](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-flow) | `7.16.7` | `7.24.1` |
| [chai](https://github.com/chaijs/chai) | `4.3.6` | `5.1.1` |
| [prettier](https://github.com/prettier/prettier) | `2.5.1` | `3.2.5` |


Updates `@babel/cli` from 7.16.8 to 7.24.5
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.5/packages/babel-cli)

Updates `@babel/core` from 7.16.12 to 7.24.5
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.5/packages/babel-core)

Updates `@babel/node` from 7.16.8 to 7.23.9
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.9/packages/babel-node)

Updates `@babel/plugin-transform-typescript` from 7.16.8 to 7.24.5
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.5/packages/babel-plugin-transform-typescript)

Updates `@babel/preset-env` from 7.22.6 to 7.24.5
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.5/packages/babel-preset-env)

Updates `@babel/preset-flow` from 7.16.7 to 7.24.1
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.1/packages/babel-preset-flow)

Updates `chai` from 4.3.6 to 5.1.1
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](chaijs/chai@v4.3.6...v5.1.1)

Updates `prettier` from 2.5.1 to 3.2.5
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.5.1...3.2.5)

---
updated-dependencies:
- dependency-name: "@babel/cli"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
- dependency-name: "@babel/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
- dependency-name: "@babel/plugin-transform-typescript"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
- dependency-name: "@babel/preset-flow"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
- dependency-name: chai
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-deps
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: actions-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the actions-deps group in /validator/imported with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [@babel/cli](https://github.com/babel/babel/tree/HEAD/packages/babel-cli) | `7.24.5` | `7.24.6` |
| [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `7.24.5` | `7.24.6` |
| [@babel/node](https://github.com/babel/babel/tree/HEAD/packages/babel-node) | `7.23.9` | `7.24.6` |
| [@babel/plugin-transform-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-typescript) | `7.24.5` | `7.24.6` |
| [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) | `7.24.5` | `7.24.6` |
| [@babel/preset-flow](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-flow) | `7.24.1` | `7.24.6` |


Updates `@babel/cli` from 7.24.5 to 7.24.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.6/packages/babel-cli)

Updates `@babel/core` from 7.24.5 to 7.24.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.6/packages/babel-core)

Updates `@babel/node` from 7.23.9 to 7.24.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.6/packages/babel-node)

Updates `@babel/plugin-transform-typescript` from 7.24.5 to 7.24.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.6/packages/babel-plugin-transform-typescript)

Updates `@babel/preset-env` from 7.24.5 to 7.24.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.6/packages/babel-preset-env)

Updates `@babel/preset-flow` from 7.24.1 to 7.24.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.6/packages/babel-preset-flow)

---
updated-dependencies:
- dependency-name: "@babel/cli"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: "@babel/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-deps
- dependency-name: "@babel/plugin-transform-typescript"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: "@babel/preset-flow"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet