---
title: "getSymbolGraph(for:options:)"
framework: swift-package-manager
role: symbol
role_heading: Instance Method
path: "swift-package-manager/documentation/packageplugin/packagemanager/getsymbolgraph(for:options:)"
---

# getSymbolGraph(for:options:)

Return a directory containing symbol graph files for the given target and options.

## Declaration

```swift
func getSymbolGraph(for target: any Target, options: PackageManager.SymbolGraphOptions) throws -> PackageManager.SymbolGraphResult
```

## Parameters

- `target`: The target to build or from which to extract symbol graphs.
- `options`: The options to use while building or extracting symbol graphs.

## Return Value

Return Value The symbol graphs for the target you specify.

## Discussion

Discussion If the symbol graphs need to be created or updated first, they will be. Swift package manager or an IDE may generate these symbol graph files in any way it sees fit.

## See Also

### Retrieving Symbols for a Package

- [PackageManager.SymbolGraphOptions](swift-package-manager/documentation/packageplugin/packagemanager/symbolgraphoptions.md)
- [PackageManager.SymbolGraphResult](swift-package-manager/documentation/packageplugin/packagemanager/symbolgraphresult.md)
