Erro React js - WP GRAPHQL

18/12/2020

0

Alguém consegue me ajudar ?
Estou recebendo o seguinte erro:

TypeError: Cannot read property ''edges'' of undefined
Case
D:/xampp/htdocs/arquivos-do-www/3x/3exceler/src/components/pages/Case/Case.js:37
34 | simboloMalha
35 |
36 | if( !loading ) {
> 37 | const { portfolios: { edges: { 0: { node } } } } = props.data
| ^ 38 | uri = node.uri
39 | seo = {
40 | title: props.data.portfolios.edges[0].node.seo.title,
View compiled
▶ 17 stack frames were collapsed.
error
D:/xampp/htdocs/arquivos-do-www/3x/src/data/QueryData.ts:294
291 | !isEqual(error, this.previousData.error)
292 | ) {
293 | this.previousData.error = error;
> 294 | this.forceUpdate();
| ^ 295 | }
296 | }
297 | });
View compiled
▶ 3 stack frames were collapsed.
(anonymous function)
D:/xampp/htdocs/arquivos-do-www/3x/src/core/ObservableQuery.ts:701
698 | // to just the observers with the given method.
699 | const observersWithMethod: Observer<E>[] = [];
700 | observers.forEach(obs => obs[method] && observersWithMethod.push(obs));
> 701 | observersWithMethod.forEach(obs => (obs as any)[method](argument));
702 | }
703 |
704 | function assertNotCacheFirstOrOnly<TData, TVariables>(
View compiled
iterateObserversSafely
D:/xampp/htdocs/arquivos-do-www/3x/src/core/ObservableQuery.ts:701
698 | // to just the observers with the given method.
699 | const observersWithMethod: Observer<E>[] = [];
700 | observers.forEach(obs => obs[method] && observersWithMethod.push(obs));
> 701 | observersWithMethod.forEach(obs => (obs as any)[method](argument));
702 | }
703 |
704 | function assertNotCacheFirstOrOnly<TData, TVariables>(
View compiled
onError [as error]
D:/xampp/htdocs/arquivos-do-www/3x/src/core/ObservableQuery.ts:627
624 | networkStatus: NetworkStatus.error,
625 | loading: false,
626 | });
> 627 | iterateObserversSafely(this.observers, ''error'', this.lastError = error);
| ^ 628 | };
629 |
630 | queryManager.observeQuery<TData>(queryId, this.options, {
View compiled
invoke
D:/xampp/htdocs/arquivos-do-www/3x/src/core/QueryManager.ts:518
515 | function invoke(method: ''next'' | ''error'', argument: any) {
516 | if (observer[method]) {
517 | try {
> 518 | observer[method]!(argument);
| ^ 519 | } catch (e) {
520 | invariant.error(e);
521 | }
View compiled
(anonymous function)
D:/xampp/htdocs/arquivos-do-www/3x/src/core/QueryManager.ts:576
573 | // If we have either a GraphQL error or a network error, we create
574 | // an error and tell the observer about it.
575 | if (errorPolicy === ''none'' && hasGraphQLErrors || queryStoreValue.networkError) {
> 576 | return invoke(''error'', new ApolloError({
| ^ 577 | graphQLErrors: queryStoreValue.graphQLErrors,
578 | networkError: queryStoreValue.networkError,
579 | }));
View compiled
(anonymous function)
D:/xampp/htdocs/arquivos-do-www/3x/src/core/QueryManager.ts:1091
1088 | // it''s possible for the listener to be undefined if the query is being stopped
1089 | // See here for more detail: https://github.com/apollostack/apollo-client/issues/231
1090 | if (listener) {
> 1091 | listener(this.queryStore.get(id), info.newData);
| ^ 1092 | }
1093 | });
1094 | }
View compiled
(anonymous function)
D:/xampp/htdocs/arquivos-do-www/3x/src/core/QueryManager.ts:1087
1084 | this.onBroadcast();
1085 | this.queries.forEach((info, id) => {
1086 | if (info.invalidated) {
> 1087 | info.listeners.forEach(listener => {
| ^ 1088 | // it''s possible for the listener to be undefined if the query is being stopped
1089 | // See here for more detail: https://github.com/apollostack/apollo-client/issues/231
1090 | if (listener) {
View compiled
QueryManager.broadcastQueries
D:/xampp/htdocs/arquivos-do-www/3x/src/core/QueryManager.ts:1085
1082 |
1083 | public broadcastQueries() {
1084 | this.onBroadcast();
> 1085 | this.queries.forEach((info, id) => {
| ^ 1086 | if (info.invalidated) {
1087 | info.listeners.forEach(listener => {
1088 | // it''s possible for the listener to be undefined if the query is being stopped
View compiled
(anonymous function)
D:/xampp/htdocs/arquivos-do-www/3x/src/core/QueryManager.ts:1237
1234 | this.invalidate(queryId);
1235 | this.invalidate(fetchMoreForQueryId);
1236 |
> 1237 | this.broadcastQueries();
| ^ 1238 | }
1239 |
1240 | if (errorPolicy === ''none'' && isNonEmptyArray(result.errors)) {
View compiled
▶ 4 stack frames were collapsed.
(anonymous function)
D:/xampp/htdocs/arquivos-do-www/3x/src/util/observables.ts:12
9 | observers.add(observer);
10 | sub = sub || inner.subscribe({
11 | next(value) {
> 12 | observers.forEach(obs => obs.next && obs.next(value));
| ^ 13 | },
14 | error(error) {
15 | observers.forEach(obs => obs.error && obs.error(error));
View compiled
next
D:/xampp/htdocs/arquivos-do-www/3x/src/util/observables.ts:12
9 | observers.add(observer);
10 | sub = sub || inner.subscribe({
11 | next(value) {
> 12 | observers.forEach(obs => obs.next && obs.next(value));
| ^ 13 | },
14 | error(error) {
15 | observers.forEach(obs => obs.error && obs.error(error));
View compiled
▶ 3 stack frames were collapsed.
next
D:/xampp/htdocs/arquivos-do-www/3x/src/index.ts:60
57 | // please also update this constant.
58 | const PRESET_CONFIG_KEYS = [
59 | ''request'',
> 60 | ''uri'',
61 | ''credentials'',
62 | ''headers'',
63 | ''fetch'',
View compiled
▶ 3 stack frames were collapsed.
(anonymous function)
D:/xampp/htdocs/arquivos-do-www/3x/src/httpLink.ts:142
139 | .then(parseAndCheckHttpResponse(operation))
140 | .then(result => {
141 | // we have data and can send it to back up the link chain
> 142 | observer.next(result);
| ^ 143 | observer.complete();
144 | return result;
145 | })
Felipe Butslof

Felipe Butslof

Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar