TypeError: Only absolute URLs are supported
I tried to query in graphql playground and I get error on terminal---- Server is running on http://localhost:4000 TypeError: Only absolute URLs are supported
and in playground, when I try to fire----
mutation CreatePrismaLink {
post(
description: "Prisma turns your database into a GraphQL API 😎",
url: "https://www.google.com"
) {
id
}
}
mutation CreateApolloLink {
post(
description: "The best GraphQL client for React",
url: "https://www.google.com"
) {
id
}
}
I get the result as ---
{
"data": null,
"errors": [
{
"message": "Only absolute URLs are supported",
"locations": [
{
"line": 8,
"column": 3
}
],
"path": [
"post"
]
}
],
"extensions": {}
}
@OmkarMS If you set up prisma endpoint by env you must install dotenv and set config. :rocket:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
I would just like to add to this just in case someone else comes along with my same problem. I had require('dotenv').config() in my file along with const { prisma } = require('./generated/prisma') but I had them in the wrong order. You have to put the dotenv config BEFORE the prisma declaration.