Open tangollama opened 4 years ago
It would be awesome to provide a hook for this as well (once we upgrade React :crossed_fingers:):
// get a specific secret (my_token)
const [token, loading] = useUserSecretQuery('my_token');
return loading
? <Spinner />
: <div>Your secret: {token}</div>;
// get all secrets
const [secrets, loading] = useUserSecretQuery();
return loading
? <Spinner />
: <ul>{secrets.map((secret, i) => <li key={i}>{secret}</li>)}</ul>;
Create a data fetching component that wraps a NerdGraph request like the following (currently only accessible in the Product schema, but to be released in some modified form later in the year).
UserSecretQuery
Query Storage Vault (i.e. secrets encrypted at rest) for user scoped secrets.
Retrieve a secret by name.
Declarative query
Imperative query
Props