这是我的组件:
import React, { Component } from 'react';
import { gql, graphql, compose } from 'react-apollo';
export class Test extends Component {
render() {
console.log("this.props: " + JSON.stringify(this.props, null, 2));
return null;
}
}
const deletePostMutation = gql`
mutation deletePost ($_id: String) {
deletePost (_id: $_id)
}
`;
export const TestWithMutation = graphql(deletePostMutation)(Test)
这似乎是一个非常简单的例子,但是当我运行它时,道具是空的:
props: {}