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

Don't run Prettier on GraphQL codegen #13073

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ vendor/
out/
dist/
shared/src/graphqlschema.ts
**/graphql-operations.ts
web/src/schema/
ts-node-*
testdata
Expand Down
3 changes: 0 additions & 3 deletions shared/dev/generateGraphQlOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ async function generateGraphQlOperations({ watch } = {}) {
{
watch,
schema: SCHEMA_PATH,
hooks: {
afterOneFileWrite: 'prettier --write',
},
Comment on lines -39 to -41
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm not so sure about this part, the file is actually not really pretty formatted and from time to time I need to go there and check the type of something, especially how it's exported, what fields it has and whether subobjects are in a separate interface or not. Without it, the whole content of one type is just in one single line, which is harder to read.
Is there a way to programmatically hook into it before writing the file content?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good point. I guess we need to wait what comes out of dotansimha/graphql-code-generator#2726 then

config: {
preResolveTypes: true,
operationResultSuffix: 'Result',
Expand Down