Custom Taxonomy fetch creates error on build.
Closed this issue · 2 comments
DanielRiveraHQ commented
The error appears on enabling a specific Custom Taxonomy to GraphQL. The taxonomy can be queried perfectly from the GraphiQL IDE within WordPress, but it breaks as soon as I run the build. I'll attach the error log. I have a repository and WordPress environment for you to replicate if needed:
ERROR
Error: Request failed with status code 500
at createError (/Users/danielrivera/Dev/revere-health-frontend/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/danielrivera/Dev/revere-health-frontend/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/Users/danielrivera/Dev/revere-health-frontend/node_modules/axios/lib/adapters/http.js:236:11)
at IncomingMessage.emit (node:events:388:22)
at endReadableNT (node:internal/streams/readable:1295:12)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
config: {
url: 'https://revere-health.hqdemo.app/graphql',
method: 'post',
data: '{"query":" query NODE_LIST_QUERY($first:Int!,$after:String,){doctorSpecialties(first:$first,after:$after,){nodes{ancestors(first:100){nodes{id}}wpChildren:children(first:100){nodes{id}}contentNodes(first:100){nodes{id __typename}}count databaseId departments(first:100){nodes{id}}description
doctors(first:100){nodes{id}}id link name onlineForms(first:100){nodes{id}}wpParent:parent{node{id}}parentDatabaseId parentId posts(first:100){nodes{id}}slug taxonomy{node{id}}termGroupId termTaxonomyId uri __typename}pageInfo{hasNextPage
endCursor}}}","variables":{"first":100,"url":"https://revere-health.hqdemo.app/graphql","after":null}}',
headers: {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json;charset=utf-8',
'User-Agent': 'axios/0.19.2',
'Content-Length': 633
},
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 30000,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus]
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
socket: [Array],
abort: [Function (anonymous)],
aborted: [Function (anonymous)],
error: [Function (anonymous)],
timeout: [Array],
prefinish: [Function: requestOnPrefinish]
},
_eventsCount: 6,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: 'revere-health.hqdemo.app',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: 'revere-health.hqdemo.app',
_readableState: [ReadableState],
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular *1],
timeout: 30000,
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 4910,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: 30000,
_idlePrev: [TimersList],
_idleNext: [Timeout],
_idleStart: 15548,
_onTimeout: [Function: bound ],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(refed)]: false,
[Symbol(kHasPrimitive)]: false,
[Symbol(asyncId)]: 5059,
[Symbol(triggerId)]: 5007
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object],
[Symbol(RequestTimeout)]: undefined
},
_header: 'POST /graphql HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json;charset=utf-8\r\n' +
'User-Agent: axios/0.19.2\r\n' +
'Content-Length: 633\r\n' +
'Host: revere-health.hqdemo.app\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: noopPendingOutput],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
scheduling: 'fifo',
maxTotalSockets: Infinity,
totalSocketCount: 6,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/graphql',
_ended: true,
res: IncomingMessage {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 500,
statusMessage: 'Internal Server Error',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular *1],
responseUrl: 'https://revere-health.hqdemo.app/graphql',
redirects: [],
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 14,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0,
[Symbol(RequestTimeout)]: undefined
},
aborted: false,
timeoutCb: [Function: emitRequestTimeout],
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'revere-health.hqdemo.app',
protocol: 'https:',
_redirectable: Writable {
_writableState: [WritableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_options: [Object],
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 633,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: [Circular *1],
_currentUrl: 'https://revere-health.hqdemo.app/graphql',
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'content-type': [Array],
'user-agent': [Array],
'content-length': [Array],
host: [Array]
}
},
response: {
status: 500,
statusText: 'Internal Server Error',
headers: {
server: 'nginx-rc',
date: 'Tue, 26 Jan 2021 05:33:07 GMT',
'content-type': 'application/json; charset=UTF-8',
'transfer-encoding': 'chunked',
connection: 'close',
expires: 'Wed, 11 Jan 1984 05:00:00 GMT',
'cache-control': 'no-cache, must-revalidate, max-age=0'
},
config: {
url: 'https://revere-health.hqdemo.app/graphql',
method: 'post',
data: '{"query":" query NODE_LIST_QUERY($first:Int!,$after:String,){doctorSpecialties(first:$first,after:$after,){nodes{ancestors(first:100){nodes{id}}wpChildren:children(first:100){nodes{id}}contentNodes(first:100){nodes{id __typename}}count databaseId departments(first:100){nodes{id}}description
doctors(first:100){nodes{id}}id link name onlineForms(first:100){nodes{id}}wpParent:parent{node{id}}parentDatabaseId parentId posts(first:100){nodes{id}}slug taxonomy{node{id}}termGroupId termTaxonomyId uri __typename}pageInfo{hasNextPage
endCursor}}}","variables":{"first":100,"url":"https://revere-health.hqdemo.app/graphql","after":null}}',
headers: [Object],
transformRequest: [Array],
transformResponse: [Array],
timeout: 30000,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus]
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype],
_eventsCount: 6,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: [TLSSocket],
_header: 'POST /graphql HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json;charset=utf-8\r\n' +
'User-Agent: axios/0.19.2\r\n' +
'Content-Length: 633\r\n' +
'Host: revere-health.hqdemo.app\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/graphql',
_ended: true,
res: [IncomingMessage],
aborted: false,
timeoutCb: [Function: emitRequestTimeout],
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'revere-health.hqdemo.app',
protocol: 'https:',
_redirectable: [Writable],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
data: {
code: 'internal_server_error',
message: '<p>There has been a critical error on this website.</p><p><a href="https://wordpress.org/support/article/debugging-in-wordpress/">Learn more about debugging in WordPress.</a></p>',
data: [Object],
additional_errors: []
}
},
isAxiosError: true,
toJSON: [Function (anonymous)]
}
Thank you for your help.
renrizzolo commented
this part indicates that your site is returning a 500 error when the query is being run.
data: {
code: 'internal_server_error',
message: '<p>There has been a critical error on this website.</p><p><a href="https://wordpress.org/support/article/debugging-in-wordpress/">Learn more about debugging in WordPress.</a></p>',
Check your php error logs, you will most likely find the cause there.
TylerBarnes commented
@renrizzolo is right, this is a PHP-side issue that can't be solved by this plugin.