text: /* @flow */
  /* eslint class-methods-use-this: "off" */
  
  import Relay from 'react-relay';
  
  export default class RemoveTodoMutation extends Relay.Mutation {
    static fragments = {
      user: () => Relay.QL`
        fragment on User {
          id
        }
      `,
    };
  
    getMutation() {
      return Relay.QL`mutation{ removeTodo }`;
    }
  
    getVariables() {
      return {
        id: this.props.id,
      };
    }
  
    getFatQuery() {
      return Relay.QL`
        fragment on RemoveTodoPayload @relay(plural: true) {
          deletedTodoId
          user
        }
      `;
    }
  
    getConfigs() {
      return [{
        type: 'NODE_DELETE',
        parentName: 'user',
        parentID: this.props.user.id,
        connectionName: 'todos',
        deletedIDFieldName: 'deletedTodoId',
      }];
    }
  
  }
  