Tags

GraphQL
API
external
quickstart

Query in the playground

To write our query for the BlogArticle, we can use the playground. Hit the playground icon in the main navigation to get there.

You should find a label in the Explorer tab with "allBlogArticle". In explorer, you got checkboxes for every field of the query you can build. 
Just click on that label to start generating the query. Once all the fields are selected inside the edges and node, try to run the query

With the explorer, you can end up with something like the GraphQL query below. You can copy this query below, paste it into your playground and run it.

query MyQuery {
  allBlogArticle {
    edges {
      node {
        slug
        text {
          json
        }
        title
      }
    }
  }
}

After executing the query, you might get a similar result, depending on what you entered during the previous steps.

{
  "data": {
    "allBlogArticle": {
      "edges": [
        {
          "node": {
            "slug": "hello-world",
            "text": {
              "json": {
                "content": [
                  {
                    "attrs": {
                      "textAlign": "left"
                    },
                    "content": [
                      {
                        "text": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitia, molestiae quas vel sint commodi repudiandae consequuntur voluptatum laborum numquam blanditiis harum quisquam eius sed odit fugiat iusto fuga praesentium optio, eaque rerum!",
                        "type": "text"
                      }
                    ],
                    "type": "paragraph"
                  }
                ],
                "type": "doc"
              }
            },
            "title": "Hello World"
          }
        }
      ]
    }
  }
}


Tags

GraphQL
API
external
quickstart