Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
const nextCoreWebVitals = require('eslint-config-next/core-web-vitals');
const { FlatCompat } = require('@eslint/eslintrc');

const compat = new FlatCompat({
baseDirectory: __dirname,
});

module.exports = [
{
ignores: ['.next/**'],
},
...nextCoreWebVitals,
...compat.extends('next/core-web-vitals'),
{
rules: {
'@next/next/no-html-link-for-pages': 'warn',
'react/display-name': 'warn',
'react/jsx-key': 'warn',
'react/no-unescaped-entities': 'warn',
'react-hooks/immutability': 'warn',
'react-hooks/set-state-in-effect': 'warn',
},
},
{
Expand Down
20 changes: 19 additions & 1 deletion lib/apolloClient/httpLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ const httpLink = new HttpLink({
fetch: (url, options) => {
// Strip excess whitespace to help mitigate query length issue
const compressedUrl = url.replace(/(%20)+/g, '%20');
return fetch(compressedUrl, options);
return fetch(compressedUrl, options).then(async response => {
if (process.env.NODE_ENV !== 'production' && !response.ok) {
let bodyText = null;
try {
bodyText = await response.clone().text();
} catch (error) {
bodyText = null;
}
console.error('[ApolloNetworkError]', {
url: compressedUrl,
status: response.status,
statusText: response.statusText,
method: options?.method,
headers: options?.headers,
bodyText,
});
}
return response;
});
},
useGETForQueries: true,
});
Expand Down
Loading
Loading