1.0.0 • Published 5 years ago

graphql-sync-h5 v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

graphql-sync-h5

A simple, modular GraphQL cache for Javascript

Install

npm install graphql-sync-h5

Quickstart

 import * as QL from 'graphql-sync-h5/graphql_cache.core';

 const graphqlEndpoint = 'http://xxx/graphql';

 componentDidMount() {
     // graphql
     console.log(QL.init(graphqlEndpoint));
   }

Usage

import * as QL from "graphql-sync-h5/graphql_cache.core";

export default (options = {collection:'', condition:'', fields: '',}) => {
  console.log("f-many:",options);
  return QL.find_many1(options.collection,options.condition,options.fields).then(res => {
    console.log("many-res:", res);
    return res;
  });
};