1.7.0 GraphQL Issues

default discord avatar
TheDunco
7 months ago
29

In attempting to update to 1.7.0, I am having some issues with the GraphQL playground specifically wherein it says my query parameters aren't provided, even when they are.

  • discord user avatar
    jmikrut
    Payload Team
    7 months ago

    hmmm - @dribbens will have info for you here

  • discord user avatar
    dribbens
    Payload Team
    7 months ago

    Can you share an example?

  • default discord avatar
    TheDunco
    7 months ago

    All it took for me to experience the issue was updating to 1.7.0, going to the /api/graphql-playground, and trying to run the same queries from before. It says that every query variable isn't defined, even though they are. Do you need a specific example?

  • discord user avatar
    jmikrut
    Payload Team
    7 months ago

    maybe a screenshot of the query you're trying to run, or a minimal example (if your query is too complex)

  • default discord avatar
    noheadphones
    7 months ago

    Seeing this issue right now in my production, let me get more info

  • default discord avatar
    TheDunco
    7 months ago

    Simple example: Logging in a user.



    Query:


    mutation Login($email: String!, $password: String!) {
      loginUser(email: $email, password: $password) {
        user {
          id
          email
        }
      }
    }


    Query Variables:


    {
      "email": "<my email>",
      "password": "<my password>"
    }


    Result pictured

    image.png
  • default discord avatar
    noheadphones
    7 months ago
    'Variable "$id" of required type "String!" was not provided.'

    in a query that worked previously, did a

    yarn upgrade


    {"query":"\n    query ArticleLikesById($id: String!) {\n  Article(id: $id) {\n    likeCount\n  }\n}\n    ","variables":{"id":"643c0a4c80bff36c46d68ddc"}}
  • discord user avatar
    jmikrut
    Payload Team
    7 months ago

    is this only in the playground



    or is it in your frontends

  • default discord avatar
    noheadphones
    7 months ago

    i can see my variables being set, this is happening for me in production frontend

  • discord user avatar
    jmikrut
    Payload Team
    7 months ago

    ok on it

  • default discord avatar
    TheDunco
    7 months ago

    Yeah, my frontend wasn't working at all when I updated locally

  • default discord avatar
    noheadphones
    7 months ago

    i dont see the deprecation notice for one of the graphql packages anymore...not sure if its related 👀



    feat: replace deprecated express-graphql dependency

    ahh i see

  • discord user avatar
    jmikrut
    Payload Team
    7 months ago

    yes



    this should not have affected anything but apparently it has

  • default discord avatar
    TheDunco
    7 months ago

    Not sure if I'm interpreting that thread correctly or not, but I did definitely change my lock file when I updated, so I do believe this is a separate issue

  • discord user avatar
    jmikrut
    Payload Team
    7 months ago

    found bug



    patch coming in a few mins

  • discord user avatar
    dribbens
    Payload Team
    7 months ago

    I'm going to add GraphQL variable use to our test coverage too. Thanks for reporting @TheDunco!

  • default discord avatar
    TheDunco
    7 months ago

    Awesome, thanks guys, you're great!Adding the test case is fantastic. It's not something you'd think to test unless it happens, yknow

  • default discord avatar
    eloahsam
    7 months ago

    Has the solution been added ?

  • default discord avatar
    noheadphones
    7 months ago

    yeah its released and working!

  • default discord avatar
    eloahsam
    7 months ago

    Oh so I just have to update all my deps

  • default discord avatar
    noheadphones
    7 months ago

    1.7.1 fixes it

  • default discord avatar
    eloahsam
    7 months ago

    yeah works well now finally

  • default discord avatar
    TheDunco
    7 months ago

    Yes, marking this thread as "answered" now, can confirm that 1.7.1 fixes it! Thanks team! @jmikrut @dribbens

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.