---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [docs](../index.md) / readSchemaByQuery

# Function: readSchemaByQuery()

> **readSchemaByQuery**(`query`): \{ `content`: `string`; `entry`: [`SchemaEntry`](../interfaces/SchemaEntry.md); `path`: `string`; \} \| `null`

Defined in: [packages/b2c-tooling-sdk/src/docs/schema.ts:91](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/docs/schema.ts#L91)

Find a schema by fuzzy query and return its content.
First attempts an exact ID match, then falls back to fuzzy search.
Returns the best match or null if no match found.

## Parameters

### query

`string`

The search query string (can be exact schema ID or fuzzy search term)

## Returns

\{ `content`: `string`; `entry`: [`SchemaEntry`](../interfaces/SchemaEntry.md); `path`: `string`; \} \| `null`

Object containing the schema entry, file content, and file path; or null if no match found
