notion-sdk-js icon indicating copy to clipboard operation
notion-sdk-js copied to clipboard

Type mismatch for relations. SDK types do not expect to see "has_more"

Open Matlor opened this issue 2 years ago • 3 comments

I fetch data from the notion api. I want to work with that data and have used the types "PageObjectResponse" and "PartialPageObjectResponse" from the sdk to define the responses I can get. For all the properties that are relations I get a type error:

'has_more' does not exist in type '{ type: "relation"; relation: { id: string; }[]; id: string; }'

The data looks like this:

Parent: { id: "%60J%3D~", type: "relation", relation: [{ id: "a8b666cc-4c8c-4e10-b612-2eb1f968b1a4" }], has_more: false, },

Matlor avatar Aug 16 '23 12:08 Matlor

Are you using the method retrieve?

devjiwonchoi avatar Aug 18 '23 14:08 devjiwonchoi

Page properties has_more is present in the document and the actual response returned

https://github.com/makenotion/notion-sdk-js/blob/7950edc034d3007b0612b80d3f424baef89746d9/src/api-endpoints.ts#L4588

https://developers.notion.com/reference/page-property-values#relation

narumincho avatar May 03 '24 01:05 narumincho