getkirby / kql

Kirby's Query Language API combines the flexibility of Kirby's data structures, the power of GraphQL and the simplicity of REST.
https://getkirby.com
MIT License
145 stars 5 forks source link

support for file methods #10

Closed bnomei closed 2 years ago

bnomei commented 4 years ago

it seems page and field methods do work but custom file methods from plugins do not.

bnomei commented 4 years ago
'fileMethods' => [
        'myurl' => function () {
            return $this->url();
        },
    ],
{
  "query": "page",
  "select": {
    "image": "page.images.first.myurl"
  }
}
bnomei commented 4 years ago

would be great so i can use my srcset plugin

{
  "query": "page",
  "select": {
    "image": "page.images.first.lazysrcset('default')"
  }
}
bnomei commented 4 years ago

like discussed on slack this would need some kind of whitelist. actually the page and fields method work in my case because of an different issue #11.

bastianallgeier commented 2 years ago