makenotion / notion-sdk-js

Official Notion JavaScript Client
https://developers.notion.com/docs
MIT License
4.96k stars 592 forks source link

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

Open Matlor opened 1 year ago

Matlor commented 1 year ago

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, },

devjiwonchoi commented 1 year ago

Are you using the method retrieve?

narumincho commented 6 months ago

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