How to use the graphql-tag.default function in graphql-tag

To help you get started, we’ve selected a few graphql-tag examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github braposo / graphql-css / src / index.js View on Github external
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 {};
        }
    });
};
github sync / reason-graphql-demo / src / bindings / ApolloHooks.bs.js View on Github external
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 {

graphql-tag

A JavaScript template literal tag that parses GraphQL queries

MIT
Latest version published 3 years ago

Package Health Score

80 / 100
Full package analysis

Similar packages