0no-co / gql.tada

🪄 Magical GraphQL query engine for TypeScript
https://gql-tada.0no.co
MIT License
2.44k stars 34 forks source link

fix(cli-utils): Add missing deduplication and normalization to `generate persisted` output #275

Closed kitten closed 2 months ago

kitten commented 2 months ago

Summary

This adds missing fragment deduplication to the generate-persisted output, and also adds parse(print()) normalization to the initial document string. The latter can be disabled now using the --disable-normalization argument, but it's unlikely that anyone would want to disable this.

[!NOTE] I noticed that unrollTadaFragments pre-parses the document. As the function isn't used in graphqlsp itself that's likely unnecessary. Removing this allows us to surface parsing errors as warnings to users. That's a separate TODO from this change though.

Set of changes

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: cc5f18b62d5db4fee664cade885690871cd08f2e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR