Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return cxs(el)(props => {
try {
const parsedQuery = isGqlQuery(query)
? query
: internalGql(buildQuery(interleave(query, interpolations), props).join(""));
return smoosh(graphql(resolver, parsedQuery, styles));
} catch (e) {
// eslint-disable-next-line no-console
console.error("Not a valid gql query. Did you forget a prop?");
return {};
}
});
};
function useQuery(query) {
var graphqlQueryAST = GraphqlTag.default(query.query);
var options = Js_dict.fromList(/* :: */[
/* tuple */[
"variables",
query.variables
],
/* [] */0
]);
var result = ReactHooks.useQuery(graphqlQueryAST, options);
var match = result.loading;
var match$1 = result.error;
var match$2 = result.data;
if (match) {
return /* Loading */0;
} else if (match$1 || match$2 === undefined) {
return /* Error */Block.__(0, ["something is wrong"]);
} else {