You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to use: const { SchemaLink } = await import('apollo-link-schema'); but this causes issues with client bundling, it will be bundled in a final bundle no matter the condition typeof window === 'undefined', but with require() it does work as intended.
This discussion was converted from issue #12951 on May 16, 2020 13:05.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Current apollo+api routes example is written in JS: https://github.com/zeit/next.js/blob/canary/examples/api-routes-apollo-server-and-client/apollo/client.js
Can someone make a TS version of this example? I'm specifically interested in how to rewrite this, so ESLint + TS wouldn't throw any errors:
I've tried to use:
const { SchemaLink } = await import('apollo-link-schema');
but this causes issues with client bundling, it will be bundled in a final bundle no matter the conditiontypeof window === 'undefined'
, but withrequire()
it does work as intended.Beta Was this translation helpful? Give feedback.
All reactions