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
For the life of me, I cannot figure out what the issue is when I provide my auth secret keys to both my ApolloServer and ApolloClient scripts. On Fauna's forum, I saw that others do not have the same issue when authenticating with the same stack: Next.js, ApolloClient & Server, and FaunaDB.
Scripts
Here's what my client and server scripts look like: pages/api/graphql.js:
On the landing page, I attempt to make GET query with useQuery and return the error if there is one. The error returned from useQuery is:
Error: Invalid database secret.
Which to me makes no sense since I have tested new DBs and new sets of keys several times and all result in the same error.
ApolloClient and ApolloServer
Since useQuery relies on the client script, I assume there is an issue with the client script, hence the Invalid database secret error, but the issue is not with the database secret being used there. It must be with something else (because I have checked my keys, over and over again, and with tried even with new keys)
ApolloServer
When I navigate to the ApolloServer endpoint, it returns the following error:
Error: Unexpected error: Unable to resolve a valid GraphQLSchema. Please file an issue with a reproduction of this error, if possible.
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
-
Issue
For the life of me, I cannot figure out what the issue is when I provide my auth secret keys to both my ApolloServer and ApolloClient scripts. On Fauna's forum, I saw that others do not have the same issue when authenticating with the same stack: Next.js, ApolloClient & Server, and FaunaDB.
Scripts
Here's what my client and server scripts look like:
pages/api/graphql.js
:pages/api/client.js
:Current experiences and knowledge
GraphQL query
On the landing page, I attempt to make GET query with
useQuery
and return the error if there is one. The error returned fromuseQuery
is:Which to me makes no sense since I have tested new DBs and new sets of keys several times and all result in the same error.
ApolloClient and ApolloServer
Since useQuery relies on the client script, I assume there is an issue with the client script, hence the
Invalid database secret error
, but the issue is not with the database secret being used there. It must be with something else (because I have checked my keys, over and over again, and with tried even with new keys)ApolloServer
When I navigate to the ApolloServer endpoint, it returns the following error:
So, I'm not sure what I'm doing wrong.
Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions