OBJECT

Mutation

link GraphQL Schema definition

  • type Mutation {
  • # Arguments
  • # event_info: [Not documented]
  • createEvent(event_info: EventInput!): Event
  • # Arguments
  • # first_name: [Not documented]
  • # last_name: [Not documented]
  • # email: [Not documented]
  • # password: [Not documented]
  • createUser(
  • first_name: String!,
  • last_name: String!,
  • email: String!,
  • password: String!
  • ): User
  • # Arguments
  • # id: [Not documented]
  • deleteAttachment(id: Int!): Attachment
  • # Arguments
  • # user: [Not documented]
  • signinUser(user: AuthProviderInput!): SigninPayload
  • signoutUser: Boolean
  • }

Sample CURL Request

            curl 'http://stage.reach24.net/graphql' \
              -H 'Content-Type: application/json' \
              -H 'Authorization: {token}' \
              -d '{
                "query"=>
                    "mutation createEvent($event:EventInput!) {
                        createEvent(event_info: $event) {id}", 
                        "variables" => {
                            "event"=>{
                                "truck_dispatch_id"=>3, 
                                "event_type_id"=>1, 
                                "editing_user"=>1, 
                                "created_by_user_id"=>1, 
                                "inspection_type"=>"General", 
                                "driver_id"=>1, 
                                "source"=>"mobile", 
                                "loaded"=>true, 
                                "drop_location"=>true, 
                                "other_location"=>"TamilNadu", 
                                "address"=>{
                                    "address"=>"Tracy, CA, USA", 
                                    "latitude"=>37.7396513, 
                                    "longitude"=>-121.4252227
                                }, 
                                "terminal_id"=>nil, 
                                "ancillary_location_id"=>nil, 
                                "equipment"=>{
                                    "equipment_number"=>"ASDF123456", 
                                    "equipment_type_id"=>1
                                }, 
                                "event_comments"=>[{
                                    "comment"=>"test event comment", 
                                    "user_id"=>1
                                }], 
                                "event_services"=>[{
                                        "service_id"=>4, 
                                        "is_approved"=>true, 
                                        "event_service_jobs"=>[
                                            {
                                                "job_id"=>4, 
                                                "defect_id"=>10, 
                                                "component_location_id"=>44, 
                                                "comment"=>"test job comment"
                                            }
                                        ], 
                                        "event_attachments"=>[
                                            {
                                                "attachment_id"=>nil, 
                                                "attachment_type_id"=>nil
                                            }, 
                                            {
                                                "attachment_id"=>nil, 
                                                "attachment_type_id"=>nil
                                            }
                                        ]
                                }], 
                                "event_equipment_categories"=>[
                                    {
                                        "status"=>"defect", 
                                        "comment"=>"defective container.", 
                                        "equipment_category_id"=>1, 
                                        "inspection_category_id"=>nil, 
                                        "event_attachments"=>[{
                                            "attachment_id"=>318, 
                                            "attachment_type_id"=>1
                                        }]
                                    }, 
                                    {
                                        "status"=>"good", 
                                        "comment"=>"all good.", 
                                        "equipment_category_id"=>1, 
                                        "inspection_category_id"=>nil, 
                                        "event_attachments"=>[{
                                            "attachment_id"=>301, 
                                            "attachment_type_id"=>1
                                        }]
                                    }
                                ]
                            }
                        }
                    }