Next.js Discord

Discord Forum

Will my server side graphql client be bundled for the browser JS bundle?

Unanswered
Indian oil sardine posted this in #help-forum
Open in Discord
Indian oil sardineOP
Hi, sorry, I'm still new to bundling, so I thought I would ask people who have worked with the framework longer.
I have a client.ts file in my Next.js project that exports two urql clients, one for the backend (to make mutations and such, has a secret API key to auth itself) and one for the frontend (to allow for simple querying for new data based on user input, will only be allowed to query things available to the client).
If the backend client is never used in the React Client Components, but is declared in the same .ts file, will it get bundled for the frontend?

Thank you very much for any info on this, and have a great day!

0 Replies