import * as React from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { CarForm } from './car-form';

import { insertCar as relayInsertCar } from '../mutations/insert-car';

export class CarFormHome extends React.Component {

    reactInsertCar = car => {
        return relayInsertCar(
            this.props.relay.environment,
            this.props.viewer.id,
            car,
        );
    };

    render() {
        return <CarForm
            onSubmitCar={this.reactInsertCar}
            onShowCarTable={this.props.onShowCarTable} />;
    }

}

export const CarFormHomeContainer = createFragmentContainer(
    CarFormHome, graphql`
    fragment carFormHome_viewer on Viewer {
      id
    }
  `
);
@@ -640,18 +640,16 @@
 tainer(%0A
-  
   CarFor
@@ -717,16 +717,151 @@
      id%0A
+      carmakes %7B%0A        edges %7B%0A          node %7B%0A            name%0A            models%0A            colors%0A          %7D%0A        %7D%0A      %7D%0A
     %7D%0A  

add makes to car form view