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

Is it possible to catch syntax errors? #10

Open
jeffwillette opened this issue Feb 6, 2018 · 0 comments
Open

Is it possible to catch syntax errors? #10

jeffwillette opened this issue Feb 6, 2018 · 0 comments

Comments

@jeffwillette
Copy link
Contributor

jeffwillette commented Feb 6, 2018

When I am using the plugin through ALE, and there is an error thrown due to bad syntax, I get no output in ALE and all linter warnings disappear. Is it possible on this end to catch syntax errors and output them nicely just like linter warnings?

# what is needed for a pet
type Pet {
    sklda
}

this syntax mistake, gives this output

Found no config file, running with default config.

/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:973
  throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected ' + kind + ', found ' + (0, _lexer.getTokenDesc)(token));
  ^
GraphQLError: Syntax Error GraphQL request (27:1) Expected :, found }

26:     sklda
27: }
    ^
28:

    at syntaxError (/Users/Jeff/.config/yarn/global/node_modules/graphql/error/syntaxError.js:31:15)
    at expect (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:973:32)
    at parseFieldDefinition (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:718:3)
    at any (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:1009:16)
    at parseObjectTypeDefinition (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:686:16)
    at parseTypeSystemDefinition (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:610:16)
    at parseDefinition (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:151:16)
    at parseDocument (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:109:22)
    at parse (/Users/Jeff/.config/yarn/global/node_modules/graphql/language/parser.js:46:10)
    at gqlint (/Users/Jeff/.config/yarn/global/node_modules/gqlint/lib/gqlint.js:28:15)

which cannot be read by ALE

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

1 participant