apollo-client
Advanced tools
Comparing version 0.3.18 to 0.3.19
@@ -7,4 +7,4 @@ import { NetworkInterface, createNetworkInterface } from './networkInterface'; | ||
import { IdGetter } from './data/extensions'; | ||
import { QueryTransformer } from './queries/queryTransform'; | ||
export { createNetworkInterface, createApolloStore, createApolloReducer, readQueryFromStore, readFragmentFromStore }; | ||
import { QueryTransformer, addTypenameToSelectionSet } from './queries/queryTransform'; | ||
export { createNetworkInterface, createApolloStore, createApolloReducer, readQueryFromStore, readFragmentFromStore, addTypenameToSelectionSet as addTypename }; | ||
export default class ApolloClient { | ||
@@ -11,0 +11,0 @@ networkInterface: NetworkInterface; |
@@ -11,2 +11,4 @@ "use strict"; | ||
exports.readFragmentFromStore = readFromStore_1.readFragmentFromStore; | ||
var queryTransform_1 = require('./queries/queryTransform'); | ||
exports.addTypename = queryTransform_1.addTypenameToSelectionSet; | ||
var isUndefined = require('lodash.isundefined'); | ||
@@ -13,0 +15,0 @@ var ApolloClient = (function () { |
@@ -17,2 +17,3 @@ import 'whatwg-fetch'; | ||
export interface NetworkInterface { | ||
[others: string]: any; | ||
query(request: Request): Promise<GraphQLResult>; | ||
@@ -23,3 +24,3 @@ } | ||
} | ||
export interface HTTPNetworkInterface extends NetworkInterface { | ||
export interface HTTPNetworkInterface extends BatchedNetworkInterface { | ||
_uri: string; | ||
@@ -26,0 +27,0 @@ _opts: RequestInit; |
@@ -8,6 +8,3 @@ "use strict"; | ||
function addQueryMerging(networkInterface) { | ||
return { | ||
query: function (request) { | ||
return networkInterface.query(request); | ||
}, | ||
return assign(networkInterface, { | ||
batchQuery: function (requests) { | ||
@@ -19,3 +16,3 @@ var composedRequest = queryMerging_1.mergeRequests(requests); | ||
}, | ||
}; | ||
}); | ||
} | ||
@@ -105,3 +102,3 @@ exports.addQueryMerging = addQueryMerging; | ||
} | ||
return { | ||
return addQueryMerging({ | ||
_uri: _uri, | ||
@@ -112,5 +109,5 @@ _opts: _opts, | ||
use: use, | ||
}; | ||
}); | ||
} | ||
exports.createNetworkInterface = createNetworkInterface; | ||
//# sourceMappingURL=networkInterface.js.map |
{ | ||
"name": "apollo-client", | ||
"version": "0.3.18", | ||
"version": "0.3.19", | ||
"description": "A simple yet functional GraphQL client.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Apollo client | ||
[![npm version](https://badge.fury.io/js/apollo-client.svg)](https://badge.fury.io/js/apollo-client) | ||
[![Get on Slack](http://slack.apollostack.com/badge.svg)](http://slack.apollostack.com/) | ||
[![npm](https://img.shields.io/npm/v/apollo-client.svg?maxAge=2592000)](https://www.npmjs.com/package/apollo-client) | ||
[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](http://www.apollostack.com/#slack) | ||
@@ -6,0 +6,0 @@ The Apollo Client can easily be dropped into any JavaScript frontend where you want to use data from a GraphQL server. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
177279