# Function: validateDependency

▸ **validateDependency**(`graph`, `dependency`): `void`

A function to validate dependencies in a [CreateDependencies](../../devkit/documents/CreateDependencies) function

**`Throws`**

If the dependency is invalid.

#### Parameters

| Name         | Type                                                                                      |
| :----------- | :---------------------------------------------------------------------------------------- |
| `graph`      | [`ProjectGraph`](../../devkit/documents/ProjectGraph)                                     |
| `dependency` | [`ProjectGraphDependencyWithFile`](../../devkit/documents/ProjectGraphDependencyWithFile) |

#### Returns

`void`
