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

pre-commit hook fail on template graphql with addmodule #523

Closed
H1net opened this issue Nov 22, 2017 · 7 comments
Closed

pre-commit hook fail on template graphql with addmodule #523

H1net opened this issue Nov 22, 2017 · 7 comments
Assignees
Labels

Comments

@H1net
Copy link
Contributor

H1net commented Nov 22, 2017

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?

@mairh
Copy link
Member

mairh commented Nov 22, 2017

@mitjade Can you have a look. I guess this is the culprit 1b94d41

@mitjade
Copy link
Collaborator

mitjade commented Nov 22, 2017

@H1net @mairh I am aware of this probmem. Will soon push some cli changes that will resolve this.

@mitjade mitjade added the bug label Nov 28, 2017
@mitjade mitjade self-assigned this Dec 1, 2017
@larixer
Copy link
Member

larixer commented Jan 17, 2018

@mitjade I wonder if this is still an issue?

@mitjade
Copy link
Collaborator

mitjade commented Jan 17, 2018

@Vlasenko It is still a problem. I am still a long way from having CRUD cli ready, so I will not be pushing any cli changes. Will check it is can resolve this.

@H1net
Copy link
Contributor Author

H1net commented Jan 19, 2018

Still an issue, though anyone having this that doesn't want to delete or complete the query could just git commit --no-verify.

I also note the added issue at the end of #605 where server graphql needs to be completed for app to build. You cannot have empty mutations/subscriptions.

These are pretty trivial problems and perhaps could just be documented.

@larixer
Copy link
Member

larixer commented 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

@lyzhovnik
Copy link
Contributor

Hi everyone. I am closing this issue, because the pull request #847 updated the CLI. And now after creating the new module You can commit and run the tests without any errors.

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

No branches or pull requests

5 participants