I'm happy to pick the fix for this up once agreed which route to go.
Expected or Desired Behavior
The taxonomy documentation page should only reference types which exist in the solution. To resolve this, one of the following needs to occur:
The docs are updated to reference TermStore.Term from @microsoft/microsoft-graph-types.
ITermInfo is re-exported as an alias of TermStore.Term
Observed Behavior
The taxonomy documentation page makes several references to ITermInfo, a type which existed in v3 but appears to have been removed in v4 when the code was ported from the sp to graph package.
There may be other types in the taxonomy package which suffer the same issue, but I have not investigated this.
Steps to Reproduce
This does not work (example copied from docs):
import { graphfi } from "@pnp/graph";
import "@pnp/graph/taxonomy";
import { ITermInfo } from "@pnp/graph/taxonomy"; // tsc error
const graph = graphfi(...);
// list all the terms that are direct children of this set
const infos: ITermInfo[] = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").children();
This does, assuming you have the Graph types package installed:
import { graphfi } from "@pnp/graph";
import "@pnp/graph/taxonomy";
import { TermStore } from '@microsoft/microsoft-graph-types';
const graph = graphfi(...);
// list all the terms that are direct children of this set
const infos: TermStore.Term[] = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").children();
I'm sure the documentation just didn't get updated as we were really struggling with time towards the release date we were targeting. Please feel free to update it if you like we'll try to get to it when we can.
Major Version
4.x
Minor Version Number
2.0
Target environment
SharePoint Framework
Additional environment details
SPFx 1.19, TypeScript 4.7, NodeJS 18.
I'm happy to pick the fix for this up once agreed which route to go.
Expected or Desired Behavior
The taxonomy documentation page should only reference types which exist in the solution. To resolve this, one of the following needs to occur:
TermStore.Term
from@microsoft/microsoft-graph-types
.ITermInfo
is re-exported as an alias ofTermStore.Term
Observed Behavior
The taxonomy documentation page makes several references to
ITermInfo
, a type which existed in v3 but appears to have been removed in v4 when the code was ported from the sp to graph package.There may be other types in the taxonomy package which suffer the same issue, but I have not investigated this.
Steps to Reproduce
This does not work (example copied from docs):
This does, assuming you have the Graph types package installed: