community query params don't seem to be working

I’m trying to query communities by tags. They are called categories in the portal but I guess they are the same thing?

Using the following code but it’s always coming back empty:

    const unSubscriber = CommunityRepository.getCommunities(
      { tags: ['Featured'] },
      ({ data: communities, onNextPage, hasNextPage, loading, error }) => {
        if (error) {
          console.log('error', error);
          setError(error);
        }
        if (loading) {
          setLoading(true);
        }
        if (communities) {
          setCommunities(communities);
        }

      },
    );

Hello @BenGannaway , categories and tags are two different things. To query communities based on category, you can use categoryId?: 'categoryId'. You can find an example in this section of the documentation: Query Communities | Social+ Docs

1 Like