Forum Discussion

Shibu Mathew's avatar
Shibu Mathew
Copper Contributor
Apr 16, 2020

SPFX @pnp/graph

Am trying to use beta endpoint for my graph API request.  I tried setEndpoint, but it run out of error. Could not find the correct way to point to beta instead of v1.0. Am trying to filter teams from the groups, but the filter is not working v1.0 endpoint. Please suggest

 

 graph.groups
      .filter(`resourceProvisioningOptions/Any(x:x eq 'Team')`)
      .get<Group[]>()
      .then((groups=> {
        console.log("groups....."groups);
        this.setState({
          groups,
        });
      });
  • Hey Shibu Mathew ,

     

    Yeah, I wan't able to use the filter in graph queries either. I haven't used PnPJS for graph requests so I'm not sure what the problem is. Anyway, I think you can use the concat function to add your filter manually, like .concat(`?$filter=resourceProvisioningOptions/Any(x:x eq 'Team')`). Let me know if it doesn't work for you.

Resources