react-apollo
Advanced tools
Comparing version 0.4.0-rc4 to 0.4.0-rc5
@@ -26,3 +26,4 @@ import { MutationBehavior, MutationQueryReducersMap } from 'apollo-client/data/mutationResults'; | ||
props?: (props: any) => any; | ||
name?: string; | ||
} | ||
export default function graphql(document: Document, operationOptions?: OperationOption): (WrappedComponent: any) => any; |
@@ -148,11 +148,9 @@ "use strict"; | ||
GraphQL.prototype.calculateResultProps = function (result) { | ||
if (mapResultToProps && this.type === parser_1.DocumentType.Query) { | ||
result.ownProps = this.props; | ||
return mapResultToProps(result); | ||
} | ||
if (mapResultToProps && this.type === parser_1.DocumentType.Mutation) { | ||
var newResult = (_a = {}, _a[operation.name] = result, _a.ownProps = this.props, _a); | ||
var name = this.type === parser_1.DocumentType.Query ? 'data' : 'mutate'; | ||
if (operationOptions.name) | ||
name = operationOptions.name; | ||
var newResult = (_a = {}, _a[name] = result, _a.ownProps = this.props, _a); | ||
if (mapResultToProps) | ||
return mapResultToProps(newResult); | ||
} | ||
return (_b = {}, _b[operation.name] = defaultMapResultToProps(result), _b); | ||
return (_b = {}, _b[name] = defaultMapResultToProps(result), _b); | ||
var _a, _b; | ||
@@ -159,0 +157,0 @@ }; |
{ | ||
"name": "react-apollo", | ||
"version": "0.4.0-rc4", | ||
"version": "0.4.0-rc5", | ||
"description": "React data container for Apollo Client", | ||
@@ -55,2 +55,4 @@ "main": "index.js", | ||
"minimist": "^1.2.0", | ||
"mobx": "^2.4.2", | ||
"mobx-react": "^3.5.4", | ||
"mocha": "^2.3.3", | ||
@@ -57,0 +59,0 @@ "pretty-bytes": "^3.0.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
856000
32
25148