- Issue created by @brianperry
- Issue was unassigned.
our getResource method accepts a type parameter:
getResource<T>(
type,
resourceId,
options?): Promise<T | RawApiResponseWithData<T>>
But getResourceByPath currently does not.
getResourceByPath(path, options?): Promise<unknown>
Adding a type parameter to getResourceByPath as well will make it less awkward to work with types.
Get a resource by path and try to access a property. You'll see an evil red squiggle.
const resource = await client.getResourceByPath(slug, {
queryString: "include=field_image",
});
console.log(resource.type);
Add the type parameter to getResourceByPath
* Implement changes
* Update tests
* Update docs
getResourceByPath will accept a type parameter.
Active
Code