-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
PageData is not a single type #653
Comments
Hello, In general (not houdini specific) I think that it's not a good idea to define If you are interested in having your data + houdini's store, you could have a look at https://www.houdinigraphql.com/api/query "Manual Loading". Let us know if I missed something. 👍 Side note, I use the star wars public api to demo things like in https://github.com/jycouet/svienna_22_10 |
Thank you for your quick answer. Notice that the load function belongs to a layout file and not a page file (that as you say would have to do manual loading, which I am not interested in). I read up on what SvelteKit describes about layout data (https://kit.svelte.dev/docs/load#layout-data) and it describes that layout data accessed from pages should still use PageData (only the same layout can use LayoutData). Therefore, I think it's a bit misleading that Houdini also exports a type called PageData even though it does not inherit the PageData normally used in SvelteKit, requiring this kind of "as" import. At least I found a shorter workaround:
I will check out the Star Wars API next time I have to use a public GraphQL API. 😉 |
Just to add my 2 cents here: I agree it's slightly misleading to not have kit's |
Closing this since #673 is merged. It will be included in the next release. Thanks for being patient @samuel-utbult-oborgen |
Describe the bug
Suppose your app.d.ts file looks like this:
And suppose you have a layout file like this:
Then, you would have a view looking like this:
This is possible to run but TypeScript complains that valueFromLoad cannot be found even though it has been specified in App.PageData. I can circumvent this problem by writing this:
When inspecting the corresponding
$houdini.d.ts
file, I see this:KitPageData
is what I referred to above asPageData
. Shouldn't the file look something like the code below?I wanted to give you a Stackbliz link but I can't get any public API I found to work. I hope this description makes it possible to reproduce the problem though.
Severity
serious, but I can work around it
Steps to Reproduce the Bug
See above.
Reproduction
No response
The text was updated successfully, but these errors were encountered: