This topic was automatically generated from Slack. You can find the original thread here.
I am trying to use the Linear integration, specifically the “search_issues”. It has a “query” input field. Can you give me an example input for this? No matter what I input I get error “GraphQL Error (Code: 400) - Variables are invalid JSON.“.
Based on the information provided, it seems like you’re encountering an issue with the “search_issues” action in the Linear integration on Pipedream. The error message “GraphQL Error (Code: 400) - Variables are invalid JSON” indicates that the input format for the “query” field might not be correctly structured as valid JSON. To help you further, I would need to see the exact input you’re providing to the “query” field. However, I can provide you with a general example of how to structure a query input for a GraphQL API. In Pipedream’s context, the input should be a JSON object with the query string properly formatted. Here’s an example structure: on { "query": "{ issues(search: \"your search term\") { nodes { id title } } }" } In this example, replace "your search term" with the actual term you’re searching for. Make sure that the entire JSON object is correctly formatted and that the query string is enclosed in double quotes. If you continue to experience issues, please provide the exact input you’re using so I can assist you further. If you need more immediate assistance, you can also visit https://pipedream.com/support for more support options.
I apologize for the confusion earlier. It seems there might be an issue with the way the query is being formatted or executed in the Linear integration on Pipedream. The error message you’re receiving suggests that the JSON being sent in the GraphQL query is not valid. To assist you better, could you please provide the exact input you’re using in the “query” field? This will help me understand the structure of your query and guide you in correcting the JSON format. If you’re not comfortable sharing the exact query, you can describe the structure or the goal of your query, and I can help you construct a valid GraphQL query for the Linear integration.
The JSON structure you’ve provided seems correct, but the error message indicates that there might be an issue with how the JSON is being sent or interpreted by the GraphQL endpoint. In Pipedream, when you’re setting up the “search_issues” action for Linear, you typically wouldn’t wrap the query in a JSON object yourself. Instead, you would input the GraphQL query directly into the “query” input field without the JSON formatting. Here’s how you should format the query in the Pipedream UI: { issues(search: "bug") { nodes { id title } } } You would input this directly into the “query” field in the Linear action on Pipedream, without the JSON object braces {} and the "query": key. If you’ve already tried this and are still facing issues, it’s possible there may be an issue with the Pipedream integration or a bug. In that case, I would recommend reaching out to Pipedream support for further assistance. You can contact them at https://pipedream.com/support.
I’m sorry to hear that you’re still experiencing issues with the GraphQL query. The error message “GraphQL Error (Code: 400) - Variables are invalid JSON” suggests that there might be a problem with the way the query is being sent to the Linear API. In Pipedream, when you configure a GraphQL action, you typically provide the query directly as a string, without the JSON object notation. However, since you’re encountering errors, let’s try a different approach to ensure that the query is properly formatted and sent as JSON. Here’s how you can format the query within a Pipedream component: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { linear: { type: "app", app: "linear", }, }, async run({ steps, $ }) { const query = ` { issues(search: "bug") { nodes { id title } } } `; return await axios($, { method: "POST", url: `https://api.linear.app/graphql`, headers: { Authorization: `Bearer ${this.linear.$auth.oauth_access_token}`, "Content-Type": "application/json", }, data: { query, }, }); }, }); Please note that you need to replace the url with the actual endpoint URL provided by Linear for GraphQL queries if it’s different from the one I’ve used above. Also, ensure that your Linear app is correctly configured in Pipedream with the necessary OAuth scopes. If you’re still facing issues after trying this, it’s best to reach out to Pipedream support for further assistance. You can contact them at https://pipedream.com/support.
I understand that you are using the pre-built “Search Issues” integration for Linear within Pipedream. If you’re receiving the error “GraphQL Error (Code: 400) - Variables are invalid JSON.” when using the integration, it could be due to an issue with the integration itself or how the data is being passed to it. Here’s what you can do to troubleshoot the issue: 1. Double-check that you are entering the query in the correct format in the Pipedream UI. It should be entered as a plain string without JSON object notation. 2. Ensure that there are no hidden characters or syntax issues in the query string you are entering. 3. If you are using any dynamic variables or expressions in your query, verify that they are being evaluated correctly. Since this seems to be an issue with a pre-built integration, and the steps above do not resolve the problem, I recommend reaching out to Pipedream Support for further assistance. They will be able to look into the integration and help you resolve the issue. Please visit https://pipedream.com/support for more support options.
if i just enter the string “bug” into the query field, I get the same error:
Error
GraphQL Error (Code: 400) - Variables are invalid JSON.
DETAILS
at null.j (/tmp/__pdg__/dist/code/aa2f525bdbe1e6aa83e08daee270a865ed54d2d4b2ef418df91c872c2a371d06/node_modules/.pnpm/@linear+sdk@11.0.0/node_modules/@linear/sdk/dist/index-cjs.min.js:1:5902)
at null.null (/tmp/__pdg__/dist/code/aa2f525bdbe1e6aa83e08daee270a865ed54d2d4b2ef418df91c872c2a371d06/node_modules/.pnpm/@linear+sdk@11.0.0/node_modules/@linear/sdk/dist/index-cjs.min.js:1:1229882)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I’m sorry to hear that you’re encountering this issue with the “Search Issues” integration in Pipedream. The error message you’re seeing indicates that there might be an issue with how the query is being processed by the integration. Since you’re using a pre-built integration, you should not have to worry about the JSON formatting of the variables yourself. Given that you’re entering just the string “bug” into the query field and still receiving the error, this could be a bug with the integration itself or an unexpected interaction with the Linear API. To resolve this issue, I recommend the following steps: 1. Ensure that you are using the integration as intended, with the correct input format expected by the “Search Issues” integration. 2. If the issue persists, consider reaching out to Pipedream support for further assistance. They may need to investigate the integration’s handling of the query and whether there’s a bug that needs to be addressed. You can contact Pipedream support at https://pipedream.com/support for more help with this issue.