with Leonardo AI and Prepr (GraphQL)?
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
leonardo_ai: {
type: "app",
app: "leonardo_ai",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://cloud.leonardo.ai/api/rest/v1/me`,
headers: {
Authorization: `Bearer ${this.leonardo_ai.$auth.api_key}`,
"accept": `application/json`,
},
})
},
})
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
prepr_graphql: {
type: "app",
app: "prepr_graphql",
}
},
async run({steps, $}) {
const data = {
"query": `query {
Posts {
items {
_id
title
}
}
}`,
}
return await axios($, {
method: "post",
url: `https://graphql.prepr.io/${this.prepr_graphql.$auth.access_token}`,
data,
})
},
})