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

Forward +page.server.ts data with automatic load #1327

Open
SeppahBaws opened this issue Jul 20, 2024 · 1 comment
Open

Forward +page.server.ts data with automatic load #1327

SeppahBaws opened this issue Jul 20, 2024 · 1 comment
Labels
Enhancement A new feature or improvement to Houdini's public API SvelteKit Issues related to the SvelteKit integration

Comments

@SeppahBaws
Copy link
Collaborator

Describe the feature

If you have a +page.server.ts where you are returning data and you have a +page.gql as well, then you will never have the data from the server load.

The current workaround is to manually write a PageLoad with return { ...event.data, ...(await load_MyQuery(event)) } which isn't ideal.

Whenever we have a +page.server.ts we should also add ...event.data to the return object of the generated load function.

Criticality

nice to have

@SeppahBaws SeppahBaws added Enhancement A new feature or improvement to Houdini's public API SvelteKit Issues related to the SvelteKit integration labels Jul 20, 2024
@AlecAivazis
Copy link
Collaborator

Note to future us: we need to make sure that the generated types correctly include both parts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A new feature or improvement to Houdini's public API SvelteKit Issues related to the SvelteKit integration
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants