Replies: 2 comments 6 replies
-
It's a bit tricky. There are two approaches to take. Limit by complexity The complexity values can be found here: https://github.com/craftcms/cms/blob/develop/src/services/Gql.php#L305-L326 This would leverage the fact that using the Just remove transforms altogether Here's the documentation: https://github.com/craftcms/cms/blob/develop/src/gql/TypeManager.php#L32-L47 |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. Reducing the complixity would also potentially affect many other queries though, right? Isn't the transform/url feature without constraint generally quite an attack vector? I mean, that would be an easy way to clog up the whole server with images. |
Beta Was this translation helpful? Give feedback.
-
Hey,
is it somehow possible to restrict image transformations in GraphQL queries? For example to predefined transformation?
I know i can disable the transform directive, but it is still possible to use the url property on assets to generate an image of any given size.
I find this a bit concerning since the GraphQL api is, after all, publicly available and so anyone can generate countless variants of the image.
Or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions