What happened?
Description
The entire GraphQL schema is read in on every request, regardless of the query complexity or query needs. Because of this our web requests are rather slow (1.5s instead of 500ms). This adds up when you have a headless front-end making 3-4 requests per page.
I believe I've identified the reason for this, here: b9d8ec5
Steps to reproduce
- Submit a GraphQL query for
{ping}.
- Notice that every matrix block is queried, every entry type is queried, etc… via the DB query log
Expected behavior
The schema should be lazy loaded, where possible.
Actual behavior
The entire schema is read every time.
Notes
I'm not sure how realistic is to reverse this decision or if there could be a config for it? Basically wondering what sort of issues I'd run in to if I tried to force a lazy schema.
Craft CMS version
4.9.5
PHP version
8.3.4
Operating system and version
Ubuntu
Database type and version
MySQL 8
Image driver and version
n/a
Installed plugins and versions
No response
What happened?
Description
The entire GraphQL schema is read in on every request, regardless of the query complexity or query needs. Because of this our web requests are rather slow (1.5s instead of 500ms). This adds up when you have a headless front-end making 3-4 requests per page.
I believe I've identified the reason for this, here: b9d8ec5
Steps to reproduce
{ping}.Expected behavior
The schema should be lazy loaded, where possible.
Actual behavior
The entire schema is read every time.
Notes
I'm not sure how realistic is to reverse this decision or if there could be a config for it? Basically wondering what sort of issues I'd run in to if I tried to force a lazy schema.
Craft CMS version
4.9.5
PHP version
8.3.4
Operating system and version
Ubuntu
Database type and version
MySQL 8
Image driver and version
n/a
Installed plugins and versions
No response