Repository: nylas/nylas-nodejs

Issue:
Implement GET FOLDER api
**Is your feature request related to a problem? Please describe.**
The node sdk doesn't have an API for returning a single folder, causing us to use the return all folders api.

https://developer.nylas.com/docs/api/v3/ecc/#tag/folders/get/v3/grants/{grant_id}/folders/{folder_id}

**Describe the solution you'd like**
Implement looking up a single folder

**Describe alternatives you've considered**
Fetching all folders

**Additional context**
Add any other context or screenshots about the feature request here.


Hints from issue comments:

Solution patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca37c2d..7878bf0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+## Unreleased
+
+### Added
+- Support for query parameters (`includeHiddenFolders`, `select`) in `folders.find` method ([#685](https://github.com/nylas/nylas-nodejs/issues/685))
+
 ## [7.13.3] - 2025-10-10
 
 ### Fixed
diff --git a/src/models/folders.ts b/src/models/folders.ts
index 58784e2..974f65b 100644
--- a/src/models/folders.ts
+++ b/src/models/folders.ts
@@ -115,4 +115,22 @@ export interface ListFolderQueryParams extends ListQueryParams {
   singleLevel?: boolean;
 }
 
+/**
+ * Interface representing the query parameters for finding a folder.
+ */
+export interface FindFolderQueryParams {
+  /**
+   * (Microsoft only) When true, Nylas includes hidden folders in its response.
+   * @default false
+   */
+  includeHiddenFolders?: boolean;
+
+  /**
+   * Specify fields that you want Nylas to return, as a comma-separated list (for example, select=id,updated_at).
+   * This allows you to receive only the portion of object data that you're interested in.
+   * You can use select to optimize response size and reduce latency by limiting queries to only the information that you need.
+   */
+  select?: string;
+}
+
 export type UpdateFolderRequest = Partial<CreateFolderRequest>;
diff --git a/src/resources/folders.ts b/src/resources/folders.ts
index 8a0fddc..5534548 100644
--- a/src/resources/folders.ts
+++ b/src/resources/folders.ts
@@ -4,6 +4,7 @@ import {
   CreateFolderRequest,
   UpdateFolderRequest,
   ListFolderQueryParams,
+  FindFolderQueryParams,
 } from '../models/folders.js';
 import {
   NylasBaseResponse,
@@ -26,10 +27,12 @@ interface ListFoldersParams {
  * The parameters for the {@link Folders.find} method
  * @property identifier The identifier of the grant to act upon
  * @property folderId The id of the Folder to retrieve
+ * @property queryParams The query parameters to include in the request
  */
 interface FindFolderParams {
   identifier: string;
   folderId: string;
+  queryParams?: FindFolderQueryParams;
 }
 
 /**
@@ -103,6 +106,7 @@ export class Folders extends Resource {
   public find({
     identifier,
     folderId,
+    queryParams,
     overrides,
   }: FindFolderParams & Overrides): Promise<NylasResponse<Folder>> {
     return super._find({
@@ -110,6 +114,7 @@ export class Folders extends Resource {
         identifier,
         folderId,
       }),
+      queryParams,
       overrides,
     });
   }



Test patch:
diff --git a/tests/resources/folders.spec.ts b/tests/resources/folders.spec.ts
index d9be072..91baacf 100644
--- a/tests/resources/folders.spec.ts
+++ b/tests/resources/folders.spec.ts
@@ -183,6 +183,34 @@ describe('Folders', () => {
         })
       );
     });
+
+    it('should call apiClient.request with queryParams in find', async () => {
+      await folders.find({
+        identifier: 'id123',
+        folderId: 'folder123',
+        queryParams: {
+          includeHiddenFolders: true,
+          select: 'id,name,updated_at',
+        },
+        overrides: {
+          apiUri: 'https://test.api.nylas.com',
+          headers: { override: 'bar' },
+        },
+      });
+
+      expect(apiClient.request).toHaveBeenCalledWith({
+        method: 'GET',
+        path: '/v3/grants/id123/folders/folder123',
+        queryParams: {
+          includeHiddenFolders: true,
+          select: 'id,name,updated_at',
+        },
+        overrides: {
+          apiUri: 'https://test.api.nylas.com',
+          headers: { override: 'bar' },
+        },
+      });
+    });
   });
 
   describe('create', () => {