eddeee888 / graphql-code-generator-plugins

List of GraphQL Code Generator plugins that complements the official plugins.
MIT License
44 stars 10 forks source link

always pick `__resolveReference` on extended types if federation is enabled and type has a `key` directive #224

Closed wilhelmeek closed 3 months ago

wilhelmeek commented 5 months ago

First off, thanks for making this package! It's real nice having a schema-first approach in TypeScript so very similar to gqlgen.

This PR attempts to address an issue where combining a federated type + locally extending that type removes __resolveReference from the generated type stubs.

This naively picks this field in addition to other fields being picked. I couldn't think of a great way to determine the exact definition to pick, but since the field is optional I figure there's not much harm.

Please let me know if there's anything you'd like changed and I'll be happy to address. (or feel free to address yourself if so inclined)

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: 07ba217126ffcad3ce25686bc3c594c1ffe541a0

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

This PR includes changesets to release 1 package | Name | Type | | ---------------------------------------- | ----- | | @eddeee888/gcg-typescript-resolver-files | Patch |

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

eddeee888 commented 5 months ago

Hi @wilhelmeek , thanks for this PR! I'll take a look in a couple of weeks after I'm back from holidays 🙏

eddeee888 commented 4 months ago

/release-snapshot

github-actions[bot] commented 4 months ago

✅ Successfully published package/s with tag pr224-run399-1!

eddeee888 commented 4 months ago

/release-snapshot

github-actions[bot] commented 4 months ago

✅ Successfully published package/s with tag pr224-run400-1!

eddeee888 commented 4 months ago

Hi @wilhelmeek , I made some changes directly to run and fix CI. Looks great!

Could you please try the alpha version for this feature when you have a chance please?

yarn add -DE @eddeee888/gcg-typescript-resolver-files@pr224-run400-1
wilhelmeek commented 3 months ago

Thanks @eddeee888! I'll give it a crack this week and let you know

wilhelmeek commented 3 months ago

@eddeee888 this seems to work as expected, thank you!

eddeee888 commented 3 months ago

Thank you @wilhelmeek ! I'll make a release sometime today 🕺

eddeee888 commented 3 months ago

This is now released as @eddeee888/gcg-typescript-resolver-files@0.7.3! Thank you for driving it forward!