PipedreamHQ / PipedreamHQ/pipedream

[FEATURE] GraphQL support for the HTTP request pre-built action

Open
#4,445 0 comments 0 reactions 0 assignees View on GitHub
enhancement tracked internally triaged
Dominant language
JavaScript
Stars
11.7k
Forks
5.8k
Avg merge
3d 10h
Merged PRs (30d)
102

Description

**Is your feature request related to a problem? Please describe.**
I would like GraphQL support for the built-in HTTP request action.

**Describe the solution you'd like**
The current HTTP request builder does an excellent job crafting REST API calls from a UI, including cURL support.

However, GraphQL query & mutation support is lacking.

**Do you have a workaround?**

Currently, I create a Node.js code step and copy a scaffolding I use repeatedly.

```javascript
import axios from 'axios'
export default defineComponent({
props: {
shopName: {
type: "string",
},
accessToken: {
type: "string"
}
},
async run({steps, $}) {
const data = {
"query": `{
orders(first: 100) {
edges {
node {
id
legacyResourceId
name
createdAt
}
}
}
}`,
}
const res = await axios({
method: "post",
url: `https://${this.shopName}/admin/api/2019-10/graphql.json`,
headers: {
"X-Shopify-Access-Token": `${this.accessToken}`,
"Content-Type": `application/json`,
},
data,
})

if(res.data.error) {
throw new Error(res.data.error);
}

return res.data;
},
})
```

**Comparable features in other tools?**
Insomania, Graphiql explorer have GraphQL support in a UI tool.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.