Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add explicit toJSON() method to queries
allows for e.g.: const articles = await Article.with("user").orderBy("createdAt", "desc").toJSON(); from a loader to explicitly return the serialized version of a model to provide it to a component. this makes it so that the version of the model that is provided during SSR is exactly equivalent to the version of the model that is made available to the component when rendered on the client. otherwise, the data made available to the component during SSR when using single fetch is the actual model instance.
- Loading branch information