You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presently, the each generated type is crammed on to a single line per type. For readability, you can run prettier on the output like this example:
#!/bin/bash
set +e
extractgqlts \
--schema ./internal/resolvers/schema.gql \
./gui/src/**/*.svelte \
> ./gui/src/lib/graphql/types.generated.ts
exit_code=$?
set -e
(
cd gui
node ./node_modules/.bin/prettier \
--write \
./src/lib/graphql/types.generated.ts
)
exit $exit_code
However, compared to extractgqlts, prettier is extremely slow. For a non-trivial project, extractgqlts takes roughly than 0.02 seconds on my machine. Prettier on the one outputted file takes over half a second!
It would be much better if we output code that was already mostly formatted such that it could reasonably be configured for being ignored by prettier. This would require some sort of minimalistic AST for the output with a flattening pass that performs indentation.
The text was updated successfully, but these errors were encountered:
Presently, the each generated type is crammed on to a single line per type. For readability, you can run prettier on the output like this example:
However, compared to extractgqlts, prettier is extremely slow. For a non-trivial project, extractgqlts takes roughly than 0.02 seconds on my machine. Prettier on the one outputted file takes over half a second!
It would be much better if we output code that was already mostly formatted such that it could reasonably be configured for being ignored by prettier. This would require some sort of minimalistic AST for the output with a flattening pass that performs indentation.
The text was updated successfully, but these errors were encountered: