35

I got the above error on a graphql query, I am using apollo-react by the way and using the Query component for rendering the data

this is my code

const GET_VEHICLE_CHECKS = gql`
query getVehicleChecks($uuid: String!) {
  tripDetails(uuid: $uuid){
    departmentAssigned{
      vehicleChecks{
        conditions{
          id
          name
          standard
          valueType
          spinnerItems
        }
      }
    }
  }

`;

and this is what my actual query looks like

{
  tripDetails(uuid: "c0e7233093b14afa96f39e2b70c047d8"){
    departmentAssigned{
      vehicleChecks{
        conditions{
          id
          name
          standard
          valueType
          spinnerItems
        }
      }
    }
    vehicleConditions{
      id
      condition{
        id
        standard
      }
      value
    }
  }
}

I tried changing variable names, but that didn't work

malik bagwala
  • 1,338
  • 2
  • 11
  • 26

1 Answers1

82

You are missing a closing bracket } at the end of your query.

const GET_VEHICLE_CHECKS = gql`
query getVehicleChecks($uuid: String!) {
  tripDetails(uuid: $uuid){
    departmentAssigned{
      vehicleChecks{
        conditions{
          id
          name
          standard
          valueType
          spinnerItems
        }
      }
    }
  }
} <- THIS
`;
Marco Daniel
  • 3,450
  • 3
  • 24
  • 32