Skip to content

Instantly share code, notes, and snippets.

@joepie91
Created April 14, 2019 23:41
Show Gist options
  • Save joepie91/8f20e242147e1f3328b50f416dac1c22 to your computer and use it in GitHub Desktop.
Save joepie91/8f20e242147e1f3328b50f416dac1c22 to your computer and use it in GitHub Desktop.
return Promise.try(() => {
let query = gql`
query SomeDrives($driveNames: [String]) {
hardware {
drives(names: $driveNames) {
path
model
size
}
}
}
`;
return graphql.graphql(schema, query, root, {}, {
driveNames: ["sda", "sdb"]
});
}).then((results) => {
console.log(util.inspect(results, {colors: true, depth: null}));
});
{ data:
{ hardware:
{ drives:
[ { path: '/dev/sda',
model: 'TOSHIBA MD04ACA400',
size: <Unit> 3.7 TiB },
{ path: '/dev/sdb',
model: 'WDC WD40EZRX-00SPEB0',
size: <Unit> 3.7 TiB } ] } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment