keystonejs / keystone

The most powerful headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
8.98k stars 1.13k forks source link

context.image.getUrl docs have nonexistent argument mode #9176

Open tv42 opened 1 week ago

tv42 commented 1 week ago

https://keystonejs.com/docs/context/overview#images-api

https://github.com/keystonejs/keystone/blob/5b451f3aff719074dff6d074a883538d107cd5f4/docs/pages/docs/context/overview.md?plain=1#L130

image.getUrl(mode, id, extension): Given a mode, id, and extension from an ImageData object, returns the src value representing the location from which the image can be accessed over HTTP.

Also seen at https://github.com/keystonejs/keystone/blob/5b451f3aff719074dff6d074a883538d107cd5f4/docs/pages/docs/context/overview.md?plain=1#L121

There's no mode in the actual API:

export type ImagesContext = (storage: string) => {
  getUrl: (id: string, extension: ImageExtension) => Promise<string>

https://github.com/keystonejs/keystone/blob/5b451f3aff719074dff6d074a883538d107cd5f4/packages/core/src/types/context.ts#L208-L209