Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.
This repository was archived by the owner on Jul 3, 2024. It is now read-only.

[Feature Request] Batch Queries #22

@rallisf1

Description

@rallisf1

So, I have a usecase where I load multiple components on my site and I had a query for each of them, but soon I realised that even though sveltekit caches the responses, the http requests were still being made and the client had to wait for like 7-8 requests upon each page navigation.

I then merged most of the queries and now only 2 requests happen on each route (1 for the components and 1 for the page content) and things are a lot better. What I noticed though on my backend is that it supports batch queries and also provides a link on apollo's documentation on how it is implemented: https://www.wpgraphql.com/docs/wpgraphql-vs-wp-rest-api/#batch-queries

As I said, 2 requests per route are fine by me and I know this is a small project and chances of implementing any new features are slim, but here it is :D

P.S. Thanks for this lib, it's actually the most painless graphql client anyone can use with sveltekit atm.
P.S.2. Just editing gFetch to support multiple queries won't cut it I'm afraid as I am fetching the components query in my main __layout, since they are common to most routes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions