question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Network error: Can't find <queryName> on object (ROOT_QUERY) undefined

See original GitHub issue
Error: Network error: Can't find **graphqlQueryName** on object (ROOT_QUERY) undefined.

It works most of the time but fails about 20% of the time.

Similar to these issues https://github.com/apollographql/react-apollo/issues/1932 https://github.com/apollographql/apollo-client/issues/3311 https://github.com/apollographql/apollo-client/issues/1701

this.hc().then(client => {
      return client.query({
        query: queryName
        fetchPolicy: network-only
      });
}).catch(err => {
      console.log('appsyncQuery err:', err);
});
this.hc().then(client => {
      const observable = client.watchQuery({
          query: queryName
          fetchPolicy: network-only
      });

      return observable.result();
}).catch(err => {
      console.log('appsyncQuery err:', err);
});

I set up appsync.service similar to this example https://github.com/aws-samples/aws-mobile-appsync-chat-starter-angular/blob/master/src/app/chat-app/appsync.service.ts

private newClient(session) {
    return new AWSAppSyncClient({
      url: appSyncConfig.graphqlEndpoint,
      region: appSyncConfig.region,
      auth: {
        type: appSyncConfig.authenticationType,
        jwtToken: session.idToken.jwtToken
      }
    }, {
      defaultOptions: {
        watchQuery: {
          fetchPolicy: 'network-only',
        }
      }
    });
  }

using “aws-appsync”: “^1.0.15”,

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:29 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
krsnaacommented, Aug 9, 2019

seeing this issue 100% of the time with AppSync in nodeJS, - https://aws-amplify.github.io/docs/js/api#aws-appsync-sdk.

setting disableOffline to true just makes the program hang.

4reactions
ericlinkcommented, Mar 7, 2019

We are

@smakman thanks - this fixed it for me as well. However I would like to be able to use the offline capabilities in Safari Mobile, since this was one of the deciding factors in choosing AWS AppSync.

Same here, key capability for our app. Is there any current activity on this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apollo GraphQL Client 'Network error: Can't find field XXXX on ...
Here is the error response from Apollo: ApolloError: Network error: Can't find field getTickets on object undefined. at new ApolloError ...
Read more >
class ApolloClient - Apollo GraphQL Docs
Returns an initialized ApolloClient object. ... For more information, see Advanced HTTP networking. ... This method will start at the root query.
Read more >
ApolloClient - Client (React) - Apollo GraphQL Docs
The constructor for ApolloClient accepts an ApolloClientOptions object that supports the ... For more information, see the advanced HTTP networking section.
Read more >
Handling GraphQL Errors with Hasura & React
404 resource not found error; Network Errors / Server Errors ... This extensions object is used by GraphQL servers (including Hasura) to add ......
Read more >
GraphQL specification
Previous editions of the GraphQL specification can be found at permalinks that ... not defined by a field of this input object type,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found