troubleshooting Question

Failed to load resource GraphQL/React

Avatar of Richard Comito
Richard ComitoFlag for United States of America asked on
7 Comments2 Solutions65 ViewsLast Modified:
I am setting up a simple weather app using React/AWS Amplify/AWS Appsync/GraphQL.

I am getting the following errors when I open the console.

Failed to load resource: https://(appsync ID)


Uncaught (in promise) 
  1. Object
    1. data: {}
    2. errors: [GraphQLError]
    3. __proto__: Object

I am a noob to React and have not used Javascript in 15 years.  So end-user error I am suspecting.

Here are my questions and code.

1) How do I go about troubleshooting these types of issues in the future?
2) How do I hand off the variable to the query to be used by appysync?
3) How do I resolve the Error just in case I am way off on my assumption?

\\Weather Componant

import React, { Component } from 'react'
import { weatherByCity } from '../graphql/queries'
import { API, graphqlOperation } from 'aws-amplify'

class DisplayWeather extends Component {

    componentDidMount = async () => {

    getWeather = async () => {

            const result = await API.graphql(graphqlOperation(weatherByCity))
            console.log('weatherByCity', JSON.stringify(result))


    render() {
        return (

export default DisplayWeather

/* eslint-disable */
// this is an auto generated file. This will be overwritten

export const weatherByCity = /* GraphQL */ `
  query WeatherByCity($city: String!) {
    weatherByCity(city: $city) {

Any advice is welcome.  Thank you in advance.


Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros