question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pre-commit hook fail on template graphql with addmodule

See original GitHub issue

With the latest in master, if you do yarn cli addmodule testmod, git add -A, and then git commit the pre-commit hook fails because of the empty graphql files with an error like below:

$ git commit
husky > npm run -s precommit (node v6.11.3)

Running tasks for *.{js,jsx,json} [started]
Running tasks for *.graphql [started]
eslint --fix [started]
prettier --parser graphql --write [started]
prettier --parser graphql --write [failed]
→ × prettier --parser graphql --write found some errors. Please fix them and try committing again.


[error] src\client\modules\testmod\graphql\TestmodQuery.graphql: SyntaxError: Syntax Error GraphQL request (2:1) Unexpected <EOF>
[error]
[error] 1: # GraphQL queries
[error] 2:
[error]    ^
[error]  (2:1)
[error]   1 | # GraphQL queries
[error] > 2 |
[error]     | ^
Running tasks for *.graphql [failed]
→ × prettier --parser graphql --write found some errors. Please fix them and try committing again.


[error] src\client\modules\testmod\graphql\TestmodQuery.graphql: SyntaxError: Syntax Error GraphQL request (2:1) Unexpected <EOF>
[error]
[error] 1: # GraphQL queries
[error] 2:
[error]    ^
[error]  (2:1)
[error]   1 | # GraphQL queries
[error] > 2 |
[error]     | ^
eslint --fix [completed]
git add [started]
git add [completed]
Running tasks for *.{js,jsx,json} [completed]
× prettier --parser graphql --write found some errors. Please fix them and try committing again.


[error] src\client\modules\testmod\graphql\TestmodQuery.graphql: SyntaxError: Syntax Error GraphQL request (2:1) Unexpected <EOF>
[error]
[error] 1: # GraphQL queries
[error] 2:
[error]    ^
[error]  (2:1)
[error]   1 | # GraphQL queries
[error] > 2 |
[error]     | ^

husky > pre-commit hook failed (add --no-verify to bypass)

I notice that similarly empty files do not throw this error for previous modules I created, though the new files seem to have “Query” in the filename so I presume some changes have been made?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lyzhovnikcommented, Sep 25, 2018

Hi everyone. I am closing this issue, because the pull request https://github.com/sysgears/apollo-universal-starter-kit/pull/847 updated the CLI. And now after creating the new module You can commit and run the tests without any errors.

0reactions
larixercommented, Jan 19, 2018

@H1net We have public wiki now, editable by anyone, we can document quirks there, should be easy now: https://github.com/sysgears/apollo-universal-starter-kit/wiki

Read more comments on GitHub >

github_iconTop Results From Across the Web

Graphql versions · Issue #605 · sysgears/apollo-universal-starter-kit ...
The yarn.lock file has two graphql versions in it. The latest dependencies are causing my ... pre-commit hook fail on template graphql with...
Read more >
black as pre-commit hook always fails my commits
What actually happens when I stage a (non-black-compliant) file and try to commit: Black goes ahead and modifies the file to make it...
Read more >
Supported hooks - pre-commit
check-autopkg-recipe-list - This hook checks AutoPkg recipe lists (in txt, plist, yaml, or json format) for common issues. check-autopkg-recipes - This hook ......
Read more >
Changelog - AWS Lambda Powertools for Python
ci: add workflow to suggest splitting large PRs (#1480); ci: add linter for GitHub Actions as pre-commit hook (#1479); ci: remove dangling debug...
Read more >
Jest mock custom hook - Caritas Castellaneta
There are two components, a ParentComponent and a ChildComponent. Jest mock a fetch function from a connected component. expect.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found