houdini
houdini copied to clipboard
Example error in documentation
trafficstars
Describe the bug
Hello!
Please update the docs below - the example given has an incorrect object passed into the fetch fn: https://www.houdinigraphql.com/api/query#manual-loading
import { MyQueryStore } from '$houdini'
export async function load(event) {
const MyQuery = new MyQueryStore()
// Next line should have MyQuery.fetch({event}) instead.
const result = await MyQuery.fetch(event)
console.log('do something with', result)
return { MyQuery }
}
This is to satisfy the check on the following line: https://github.com/HoudiniGraphql/houdini/blob/cd00b5f436412ecc3ac2225d2ee8a9201b172da0/src/runtime/stores/query.ts#L406
Severity
serious, but I can work around it
Steps to Reproduce the Bug
Run the example code above, it won't work. The object passed in fetch needs to be {event} not event.
Reproduction
No response
Thanks for opening this @yasserlens!
Would you mind submitting a PR with the fix? i'm a bit busy for the next few days
This has now been fixed.