Licence
MIT
Version
1.1.3
Deps
0
Size
260 kB
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)
gql-get

GraphQL Query inspired getter function to return values from objects including lists with same shape objects.
Example
import get from 'gql-get';
const response = {
data: [
{ type: 'User', name: 'Dennis'},
{ type: 'User', name: 'Fred'},
{ type: 'User', name: 'Boris'}
]
}
const names = get<string[]>(response, 'data.name');
// > ['Dennis', 'Fred', 'Boris']