Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does GraphQL request supose to work? #1335

Open
MariuzM opened this issue Dec 19, 2024 · 3 comments
Open

How does GraphQL request supose to work? #1335

MariuzM opened this issue Dec 19, 2024 · 3 comments

Comments

@MariuzM
Copy link

MariuzM commented Dec 19, 2024

I'm making GQL request but getting error, how does this supose to work in RestClient?

image

@nzjames
Copy link

nzjames commented Jan 13, 2025

It doesn't look like you've included the additional header in your request. Does it work when this is added?

X-REQUEST-TYPE: GraphQL

Making GraphQL Request (README.md)

@Atko
Copy link

Atko commented Jan 30, 2025

Same here, I'm trying to figure out how to make a simple graphql request, but I can't make it work no matter which service I try to access: github, monday, geographql, etc... all of them complains about "bad/invalid request". Meanwhile the same request works perfectly with curl, Insomnia or Thunder Client inside the vscodium.

My request looks like this:

POST https://api.monday.com/v2
Content-Type: application/json
Authorization: {{ $dotenv MONDAY_TOKEN }}
X-REQUEST-TYPE: GraphQL

{
  me {
    is_guest
    created_at
    name
    id
  }
}

And the response:

{
  "errors": [
    {
      "message": "Invalid GraphQL request",
      "extensions": {
        "details": "failed to deserialize the request body into JSON: key must be a string at line 2 column 3",
        "code": "INVALID_GRAPHQL_REQUEST"
      }
    }
  ],
  "account_id": 12345678
}

VScodium 1.96.4
Rest Client 0.26.0

@Atko
Copy link

Atko commented Jan 30, 2025

I'm making GQL request but getting error, how does this supose to work in RestClient?

image

#1292 (comment)

The answer is as easy as writing

X-REQUEST-TYPE: graphql

instead of

X-REQUEST-TYPE: GraphQL

(lowercase the 'graphql' string in the x-request-type header)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants