Closed kkazala closed 5 months ago
Hi, the delta query may not always contain a deltaLink, it may contain a nextLink instead. You'll get one or the other depending on if you've completed the getting all the changes, or if there are still more changes you need to retrieve.
Can you confirm if you have a @data.nextLink
in the response?
@bcameron1231 I don't. Neither @odata.deltaLink
nor @data.nextLink
I have only 1 item that changed during this time span, so I should get @odata.deltaLink
, but it looks like it's removed for some reason
Hi @kkazala . Ah, my apologies. The reason is that the PnPjs default parser is used when using graphGet. This parser only returns the value from the response. In order to fix this, you can use the JSONParse behavior on your spfi or Graph Queryable objects.
Here is an example of doing it right on the eventsQuery GraphQueryable object.
const events = this.graph.users.getById(sharedMailbox);
const eventsQuery = GraphQueryable(events, `/calendarView/delta?startDateTime=2024-03-04&endDateTime=2024-03-22&`).using(JSONParse());
const result= await graphGet(eventsQuery);
This could also be done for all graph requests if you wish.
const graph = graphfi().using(JSONParse());
We will also have better delta support in v4.
Closing this issue as answered. If you have additional questions or we did not answer your question, please open a new issue, ref this issue, and provide any additional details available. Thank you!
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.
What version of PnPjs library you are using
3.x
Minor Version Number
17
Target environment
All
Additional environment details
The question is not environment specific
Question/Request
I want to retrieve changes to the calendar events as described in Get delta The CalendarView doesn't return
@odata.deltaLink
I tried usinggraphGet
:but the
@odata.deltaLink
is also removed. Is there a way to retrieve it, using pnp js?