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

Generate factories for fragments that use aliases #54

Open
stephenh opened this issue Jun 22, 2023 · 0 comments
Open

Generate factories for fragments that use aliases #54

stephenh opened this issue Jun 22, 2023 · 0 comments

Comments

@stephenh
Copy link
Contributor

Currently, all of our factories are generated for a given object type, with the assumption that any fragments/queries that use an object type will need a subset of the fields, so the object type, being the superset of fields, will always be able to fulfill any given fragment/query.

However, this assumption doesn't hold true for fragments that use aliases.

We've happened to fix this for the top-level response of queries in our sister library:

homebound-team/graphql-typescript-response-factories#20

But it'd be good to handle it for non-top-level fragments as well.

We could potentially detect fragments that use aliases, and then for those fragments generate special newMyFragment types, that used the aliased names.

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

No branches or pull requests

1 participant