Variables never provided for my production application

default discord avatar
limegorilla
last month
37

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.

  • discord user avatar
    Jarrod
    Payload Team
    last month

    This is a graphql error, and you are certain you are passing a slug to your query?

  • default discord avatar
    limegorilla
    last month

    I'm running the same query



    Doing it inside postman - only thing that changes is the domain



    from localhost > my production URL

  • discord user avatar
    Jarrod
    Payload Team
    last month

    is this a custom graphql query or a baked in one?

  • default discord avatar
    limegorilla
    last month

    wdym by baked in one?





    That's the exact query I'm running

    image.png
  • discord user avatar
    Jarrod
    Payload Team
    last month

    Interesting, so from postman it does

    not

    work. Can you enable graphql playground on the prod instance?

  • default discord avatar
    limegorilla
    last month

    Hmmm - will do

  • discord user avatar
    Jarrod
    Payload Team
    last month
    // payload.config.ts
    graphQL: {
      disablePlaygroundInProduction: false,
    }


    (then build and serve obviously)

  • default discord avatar
    limegorilla
    last month

    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

    image.png
    image.png
  • discord user avatar
    Jarrod
    Payload Team
    last month

    Does seem strange, can you remove the "id" param from dev

  • default discord avatar
    limegorilla
    last month

    Yes - that's just for another query



    Also not an access thing



    Thats on production

    image.png
  • discord user avatar
    Jarrod
    Payload Team
    last month

    yep just want to make them exactly the same đź‘Ť

  • default discord avatar
    limegorilla
    last month

    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

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.