Graphql request with srcset(sizes:["1x", "2x"]) craft becomes unresponsive and times out (503)
Open
Nobody has claimed this yet.
bug
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
I'm trying to query an asset with grapqhl srcset but craft times out or stops responding to any requests (also in the admin section). It's definitely the srcset attribute as if I remove it, query returns fine and very fast.
headerAsset {
id
title
url
srcset(sizes:["1x", "2x"])
}
I also tried something like this but didn't help:
headerAsset @transform(format: "jpg") {
id
title
url
srcset(sizes:["1x", "2x"])
}
Steps to reproduce
- Update existing craft installation.
- Try to query srcset on an asset in graphql.
Additional info
- Craft version: 3.5.15.1 Pro
- PHP version: 7.4.12
- Database driver & version: MySQL 5.7.26
- Image driver & version | Imagick 3.4.4 (ImageMagick 7.0.10-10)
- Plugins & versions: Craft Reporter | 1.5.5, GraphQL Srcset | 1.0.5 (also tested with this plugin deactivated), Redactor | 2.8.3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the GraphQL asset query with srcset(sizes:["1x", "2x"]) on the reported Craft 3.5.15.1 setup, then compare it with the same query without srcset and with GraphQL Srcset deactivated. No source file or test is named; done means the query and admin requests no longer time out with a 503.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, mysql, php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100