title: Relay optimistic response when using REQUIRED_CHILDREN config
body: <p>I have a mutation that looks like so:</p>
  
  <pre><code>export default class CreateTaskMutation extends Relay.Mutation {
      //noinspection JSUnusedGlobalSymbols
      getMutation() {
          return Relay.QL`
              mutation {
                  createTaskMutation
              }
          `;
      }
      //noinspection JSUnusedGlobalSymbols
      getCollisionKey() {
          return `check_${this.props.id}`;
      }
  
      //noinspection JSMethodCanBeStatic,JSUnusedGlobalSymbols
      getFatQuery() {
          return Relay.QL`
              fragment on CreateTaskMutationPayload {
                  savedTask {
                      _id,
                      isPublic,
                      isDone,
                      taskDescription {
                          description
                      }
                  }
              }
          `;
      }
  
      // noinspection JSUnusedGlobalSymbols
      getConfigs() {
          return [{
              type: 'REQUIRED_CHILDREN',
              children: [
                  Relay.QL`
                      fragment on CreateTaskMutationPayload {
                          savedTask {
                              _id,
                              isPublic,
                              isDone,
                              taskDescription {
                                  description
                              }
                          }
                      }
                  `
              ]
          }];
      }
  
      //noinspection JSUnusedGlobalSymbols
      getVariables() {
          return {
              cookie: this.props.cookie,
              owner: this.props.owner,
              taskDescription: this.props.taskDescription,
              isPublic: this.props.isPublic,
              isDone: this.props.isDone
          };
      }
  
      //noinspection JSUnusedGlobalSymbols
      getOptimisticResponse() {
          return {
              savedTask: {
                  owner: this.props.owner,
                  taskDescription: this.props.taskDescription,
                  isPublic: this.props.isPublic,
                  isDone: this.props.isDone
              }
          };
      }
  }
  </code></pre>
  
  <p>And I am using it like so:</p>
  
  <pre><code>Relay.Store.commitUpdate(
      new CreateTaskMutation({
          cookie: this.state.cookie,
          owner: this.state.id,
          taskDescription: {description: this.state.taskDescriptionInput},
          isPublic: this.state.isTaskPublic,
          isDone: this.state.isTaskDone
      }),
      {
          onSuccess: (response) =&gt;  {
              const newArray = this.state.newlyAddedTasks;
              newArray.push(response.createTaskMutation.savedTask);
              this.setState({
                  newlyAddedTasks: newArray
              });
          }
      }
  );
  </code></pre>
  
  <p>Now, when you use a config like FIELDS_CHANGED I could do <code>this.props.relay.hasOptimisticUpdates(&lt;some item&gt;)</code>, but since I am creating
  something that the relay store does not know about yet, there is no DataID for it to look up. So, my current solution is to use two sources for tasks, the relay fragment response, and a piece of state that I update on success.</p>
  
  <pre><code>&lt;CreateTaskRequestBox
      tasks={this.props.currentUserFragment.userField.tasks}
      newTasks={this.state.newlyAddedTasks}
  /&gt;
  </code></pre>
  
  <p>Is there a neat way for me to put an optimistic response in the Relay Store and have it be update like if I had used FIELDS_CHANGED config? My current solution seems a bit hacky, and it isn't optimistic.</p>