Please specify what version of the library you are using: [2.0.12]
I am trying to call endpoint like https://graph.microsoft.com/v1.0/search/query. I am not able find any method or function which can do this. Also in future if I need to call anyother endpoint how can it be done?
You can always build out queries such as:
import { graph, GraphQueryableCollection, graphPost } from "@pnp/graph";
import { body } from "@pnp/odata";
const query = GraphQueryableCollection("https://graph.microsoft.com/v1.0", "search/query");
const result = await graphPost(query, body({
"requests": [
{
"entityTypes": [
"site"
],
"query": {
"queryString": "test"
}
}
]
}));
We can also look at adding (or accepting a PR) to add additional functionality natively.
thanks @patrick-rodgers do I have to do anything additional for authentication or graph setup... this is what my constructor looks like.... I am using in Teams Bot...
graph.setup({
graph: {
fetchClientFactory: () => {
return new AdalFetchClient("tenantId", appId, appPassword);
}
}
});
graph.setEndpoint("beta");
I have not tested in a Teams bot - interested to hear what you learn.
@NWH-SAmin5 I would also be interested to hear what toolkit you are using! It's when I started playing with Teams solutions that I started having build issues, as reported in issue #1461.
Added support for graph search in 2.1.0 scheduled to go our Jan 15 2021.
Most helpful comment
You can always build out queries such as:
We can also look at adding (or accepting a PR) to add additional functionality natively.