Graphql query to JSON

Please help me convert this graphql query to json

query{
podcast_content_options(search: {search_string: “pod”, content_type: PODCAST_NETWORK})
{
type
value
label

}
}

Hi @shrishti.diggikar

The GraphQL query you provided is already in a structured format and represents a request for specific data from a GraphQL API. However, if you want to represent this query in JSON format, you can do so by creating a JSON object with similar structure.

{
  "query": {
    "podcast_content_options": {
      "search": {
        "search_string": "pod",
        "content_type": "PODCAST_NETWORK"
      },
      "type": true,
      "value": true,
      "label": true
    }
  }
}

Hope this helps, Regards!

Hi @fernando_zuluaga

Thanks for replying!

I’m getting the following error when using the JSON format suggested by you - {“errors”:[{“message”:“0”}]}

Can you please help elaborate what this error is as well as how to resolve it?

Thanks!

@shrishti.diggikar

Welcome to the community

Pass this to deserialize json activity and you would get a jobject output as required

Cheers

The query that worked -

“{”“query”“:”“query{\npodcast_content_options(search:{search_string:"”“+ Show_Name+”"",content_type:PODCAST_NETWORK

})\n{\ntype\nvalue\nlabel\n\n

}\n

}“”

}"

FYI - I’m passing ShowName as a variable

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.