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

fix(nova-react-test-utils): bump relay, relax generate types in relay case, add example and docs for working with client extensions #127

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

sjwilczynski
Copy link
Contributor

@sjwilczynski sjwilczynski commented Oct 18, 2024

In scope of this PR we:

  • bump relay to ^18
  • bump @graphitation packages to latest
  • relax type for generateFunction so that one can use relay's MockPayloadGenerator without type issues (which was the case in 1JS)
  • add docs how to work around client extensions not working in current default generator, test it in examples repo

Comment on lines +325 to +326
mockClientData: true,
generateDeferredPayload: true, // this makes sure mock data is array of deferred payloads, not a single response
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't people want this for most use cases? I'm thinking it would be nice to make this the default behavior.

Could we expose a default generateFunction from @nova/react-test-utils/relay that does exactly this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point but my take is that we shouldn't. I still want to solve it properly in scope of #125 which will require some changes in artefacts generated by the compile. Graphitation's payload generator is much better in terms generation when mock resolvers are not specified, relay's one is just buggy. Even if you check test cases in relay-test-utils a lot of snapshots just don't make sense

Copy link
Member

Choose a reason for hiding this comment

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

Even if you check test cases in relay-test-utils a lot of snapshots just don't make sense

Probably our brother GPT that made them 🙃

Yes, let's not do this yet.

@sjwilczynski sjwilczynski merged commit 544e821 into microsoft:main Oct 25, 2024
2 checks passed
@sjwilczynski sjwilczynski deleted the user/stwilczy/bumpRelay branch October 28, 2024 12:06
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

Successfully merging this pull request may close these issues.

3 participants