Network error: Can't find <queryName> on object (ROOT_QUERY) undefined
See original GitHub issueError: 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:
- Created 5 years ago
- Reactions:6
- Comments:29 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
We are
Same here, key capability for our app. Is there any current activity on this issue?