Skip to content

Conversation

ahuseyn
Copy link
Member

@ahuseyn ahuseyn commented Aug 20, 2025

Description

This PR adds following:

  • data-fetching package. This is an initial phase of the package. Could be merged with template-hierarchy or graphql in the future or stand as is.
  • enablePreview utility for the nextjs adapter. It gives a customizable API handler to enable the Draft Mode.
  • kitchen-sink example for Nextjs to include all the available features (template-hierarchy, previews, data-fetching). It'll be the working ground for future development.

and updates following:

  • graphql client package to fix some errors and allow custom headers for auth
  • templateHierarchy.js to add seedNode property to templateData. We should remove seedQuery in favor of seedNode, as it better represents the value assigned to it.
  • seedQueryExecutor.js to add databaseId and asPreview parameters

Related Issue(s):

Copy link
Member

@josephfusco josephfusco left a comment

Choose a reason for hiding this comment

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

Great work @ahuseyn!

I left some non-blocking feedback to consider.

return client.request(print(query), queryVariables);
});

const results = await Promise.all(queryCalls);
Copy link
Member

Choose a reason for hiding this comment

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

Consider using Promise.allSettled instead of Promise.all

This would allow successful queries to return even if one fails.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Joe, my initial motivation to use Promise.all was this comment, but we should definitely reevaluate that approach in new Faust.

@ahuseyn ahuseyn merged commit c39b4ac into next Aug 28, 2025
0 of 13 checks passed
@ahuseyn ahuseyn deleted the next-add-data-fetching branch August 28, 2025 14:25
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.

[experimental]: PoC Previews + Nextjs Implementation [experimental]: GraphQL Data Fetching Support
2 participants