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): adjust types to properly support pure Relay components #113

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

sjwilczynski
Copy link
Contributor

The decorator is written in such a way that in can support pure Relay components, not only Nova. As it adds some features on top of Relay addon, making sure using it for pure Relay components can increase consistency and DX of working on Relay/Nova components. In scope of this PR we adjust decorator typing to support using without directly depending on @nova/react.

Stanislaw Wilczynski added 2 commits September 19, 2024 13:14
@sjwilczynski sjwilczynski enabled auto-merge (squash) September 19, 2024 11:25
packages/examples/package.json Show resolved Hide resolved
@@ -82,7 +83,11 @@ export function getRenderer(
): React.FC<React.PropsWithChildren<unknown>> {
if (query) {
const Renderer: React.FC<unknown> = () => {
const { data } = useLazyLoadQuery(query, variables);
const { data } = useLazyLoadQuery(
// There are no consequences of the cast, we do it only to make sure pure relay components can also leverage the decorator
Copy link
Member

Choose a reason for hiding this comment

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

During runtime this would be replaced with the runtime document, so it's not actually even this type.

Which when using Nova and Relay should be the same document. But not sure if that is worth adding to the comment?

@sjwilczynski sjwilczynski merged commit 5199008 into microsoft:main Sep 19, 2024
2 checks passed
@sjwilczynski sjwilczynski deleted the stwilczy/supportRelay branch September 19, 2024 14:09
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.

2 participants