houdini icon indicating copy to clipboard operation
houdini copied to clipboard

Forward +page.server.ts data with automatic load

Open SeppahBaws opened this issue 1 year ago • 1 comments
trafficstars

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 avatar Jul 20 '24 15:07 SeppahBaws

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

AlecAivazis avatar Jul 23 '24 08:07 AlecAivazis

I think with the direction we're headed this is no longer needed. happy to reopen if you think its still relevant @SeppahBaws

AlecAivazis avatar Jul 05 '25 06:07 AlecAivazis