How to use the vue-apollo.ApolloQuery.apollo function in vue-apollo

To help you get started, we’ve selected a few vue-apollo 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 abhiaiyer91 / apollo-fragment / packages / apollo-fragment-vue / src / ApolloFragment.js View on Github external
query() {
      return {
        ...ApolloQuery.apollo.query(),
        query() {
          return this.$data.query;
        },
        variables() {
          return this.$data.variables;
        },
        skip: false,
        fetchPolicy: 'cache-only',
        result(result) {
          const { errors, loading, networkStatus } = result;
          let { error } = result;
          result = Object.assign({}, result);

          if (errors && errors.length) {
            error = new Error(`Apollo errors occured (${errors.length})`);
            error.graphQLErrors = errors;