Really weird one here. I have Payload deployed on an Azure Linux instance, deploying locally from my machine.
When writing out queries to (even a production) server that's running locally - everything works as it should, but when deployed on Azure, I get:
{
"errors": [
{
"message": "Variable \"$slug\" of required type \"String!\" was not provided.",
"locations": [
{
"line": 1,
"column": 24
}
]
}
]
}
Any ideas? There's no differences between local and cloud.
This is a graphql error, and you are certain you are passing a slug to your query?
I'm running the same query
Doing it inside postman - only thing that changes is the domain
from localhost > my production URL
is this a custom graphql query or a baked in one?
wdym by baked in one?
That's the exact query I'm running
Interesting, so from postman it does
notwork. Can you enable graphql playground on the prod instance?
Hmmm - will do
// payload.config.ts
graphQL: {
disablePlaygroundInProduction: false,
}
(then build and serve obviously)
doing so now!
Production
Dev:
Copy/pasted all of the details in
so It's not my query
Just simplified it down to title and the query still doesnt seem to work
For clarity - neither my
payload.config.ts
or
server.ts
are just the ones you get from the blog starter - minus my own collections of course
Nothing in logs either
Does seem strange, can you remove the "id" param from dev
Yes - that's just for another query
Also not an access thing
Thats on production
yep just want to make them exactly the same 👍
unfortunately makes no difference
I'm 1/2 way through deploying to railway to check and see if it's an Azure thing
Don't think it is though - there are no changes to the default config made there
No change
This is dependency related @Jarrod - deleting my
yarn.lock
(which doesn't get passed to Azure) makes this happen on localhost
So if I am correct - 90% sure
"dependencies": {
"dotenv": "8.2.0",
"express": "4.17.1",
"payload": "1.6.28"
},
One of these is the culprit - assuming it will be the payload library itself importing the newest version of something which has a bug
I'll assume it's Apollo's GraphQL library?
I'm just re-deploying to Azure now so this should let me know if I am right or not
This was it!
Locking those variables in seems to have worked
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.