graphql/execution/paths
Functions
responsePathAsArray()
Given a Path, return an Array of the path keys.
Signature:
responsePathAsArray(path: null | undefined | Readonly<Path>): (string | number)[]
Arguments
| Name | Type | Description |
|---|---|---|
| path | null | undefined | Readonly<Path> | The linked response path to flatten. |
Returns
| Type | Description |
|---|---|
(string | number)[] | An array of response path keys from root to leaf. |
Example
import { pathToArray } from 'graphql/execution';
const result = pathToArray(path);
// result contains the pathToArray return value