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

Name/TypeName/StringValue AST Node? #38

Open
xuorig opened this issue Sep 6, 2020 · 1 comment
Open

Name/TypeName/StringValue AST Node? #38

xuorig opened this issue Sep 6, 2020 · 1 comment

Comments

@xuorig
Copy link

xuorig commented Sep 6, 2020

Would you ever consider having a TypeName/StringValue AST node? This would help some tooling be more precise when it comes to the location of a certain node.

Currently working on a linter and noticed I can only reference the position of a type definition and it would be quite useful to get the location of a TypeName/StringValue node 👇

error: my_type should be PascalCase

type my_type {
     ^^^^^^^
  a: String!
}

Happy to contribute something if you see value in it. Looks like the Text trait / NameMatch token could potentially have a Pos?

Example from GraphQL-JS (https://github.com/graphql/graphql-js/blob/master/src/language/ast.js#L238-L242)

@LegNeato
Copy link
Member

This seems like a good addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants