Diizzayy / nuxt-graphql-client

⚡️ Minimal GraphQL Client + Code Generation for Nuxt3
https://nuxt-graphql-client.web.app
MIT License
366 stars 44 forks source link

How to protect token for backend #231

Closed iBobik closed 2 years ago

iBobik commented 2 years ago

Hi, I use this module mostly for generating frontend, so it is ok to be presend on the client, but I also have "admin" token intended only for backend API.

I expected that when I create second client used only on the server to protect its secret, but it will be exported to the frontend anyway.

I also tried to override graphql-client config in runtimeConfig.private, but it seems this module does not recognize it there.

Is there some other way how to use this client on the server, but protect secrets?

iBobik commented 2 years ago

Aha, I just misunderstood what retainToken does. Sorry :-)