Sending Data to GraphQL API with API Connector

I am looking to send a request with two dynamic fields for my users to input a link and their email the API which uses GraphQL and. This data is then sent to create an item in Monday.


Following the advice of Bubble, I have create a GraphQL request that works in Postman, but have been unable to find any documentation on how to send a GraphQL request with dynamic fields. With GraphQL becoming more commonly used by API developers, this would be useful. Wondering if anyone has any insight or has done similar?

I’ve attached the query I am using below.

mutation {create_item (board_id: 428943437, group_id: "topics", item_name:"Test POST (ignore)", column_values:"{ \"owner\": \"\", \"gsheets_link\": \"\"}") {id}}

Hey @nicholas.c did you find a solution? Any chance you can share here the solution?

1 Like

@defaria.anthony Now I’m wondering did you find a solution? Stuck on the same thing…

Any chance you could share the solution here

In the API connector, you’ll want to do something like this:

  • Select JSON as the data type.
  • Add a Content-Type header with a value of application/json (if a plugin, add this as a shared header).
  • Add an Authorization header per’s instructions.

Now, the body. It will probably look something like this:

  "query": "mutation { create_item( board_id: 428943437, ... }"

You can get a bit fancier with variables. I don’t know the GraphQL schema so here is a contrived example:

  "query": "mutation LoginWithEmail($password: String!, $email: String!) { loginWithEmail(password: $password, email: $email) { accessToken } }",
  "variables": {
    "email": <email>,
    "password": <password>

Note that you do not need to include the \n line break in the strings (and also, you cannot put line breaks in a string anyway in JSON).

If you are using something like the Apollo Sandbox, you can run your GQL through an online site like this to strip the new lines and compact the space:

Hope this helps.

1 Like