Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
query = async (query: QueryOptions): Promise> => {
const gql = this.hub && this.hub.graphql;
if (!gql) {
Logger.debug(`Not available for query: ${query}`, GRAPHQL_COMPONENT_ID);
return {
data: null,
loading: false,
networkStatus: NetworkStatus.error,
stale: false
} as any;
}
Logger.debug(`Request: ${JSON.stringify(query, null, 2)}`, GRAPHQL_COMPONENT_ID);
const rsp = await gql.query(query);
Logger.debug(`Response: ${JSON.stringify(rsp, null, 2)}`, GRAPHQL_COMPONENT_ID);
return rsp;
}