Lesson 7: Retrieve An Object

Retrieve Your Objects

We'll now use a query to retrieve the object created in the previous steps.

In this query we'll retrieve the football_club and the seasons related to the football_club. We're also returning all the metadata we've attached to all of these objects.

Note that we supply the user dimensions to the request. In this example we're using the vip customer type as that is within the availability window we set earlier. If you change the customer type dimension value to standard you'll see that the object does not get returned.

📘

Remember your dimensions!

In the previous examples we have applied the customer-types and region dimensions to the objects that that have been created.

You must supply values for these dimensions in the request to get the object otherwise it won't be found.

{
  getFootballClub(
    uid: "<your football club uid>"
    dimensions: [{dimension: "customer-types", value: "vip"}, {dimension: "region", value: "europe"}]
  ) {
    uid
    club_name
    stadium_location
    stadium_name
    league
    league_position
    number_of_draws
    number_of_losses
    number_of_wins
    seasons {
      objects {
        uid
        title
        episodes {
          objects {
            uid
            title
            slug
            episode_number
            synopsis
          }
        }
      }
    }
  }
}

And here's the final result:

{
  "data": {
    "getFootballClub": {
      "uid": "01GSD645N6HZRA8658Z1XHYGSS",
      "club_name": "Leyton Orient",
      "stadium_location": "London",
      "stadium_name": "Brisbane Road",
      "league": "EFL League Two",
      "league_position": 1,
      "number_of_draws": 4,
      "number_of_losses": 8,
      "number_of_wins": 22,
      "seasons": {
        "objects": [
          {
            "title": "2021-2022 Season",
            "episodes": {
              "objects": [
                {
                  "title": "Leyton Orient vs West Ham",
                  "slug": "leyton-orient-vs-west-ham",
                  "episode_number": 1,
                  "synopsis": "Leyton Orient beat West Ham in a thrilling FA Cup Third Round Play Off"
                },
                {
                  "title": "Leyton Orient vs Tottenham Hotspur",
                  "slug": "leyton-orient-vs-tottenham-hotspur",
                  "episode_number": 2,
                  "synopsis": "Leyton Orient lose to Spurs in a heroic FA Cup Fourth Round Match"
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Everything Is Visible!

You can now see the objects you created in the Skylark Content Library - including the new Object Type.

Tutorial Complete!

You can now get to work on adding images, extra metadata, extra episodes, seasons etc. You can also now create sets and relationships to really start to harness the power and potential of your IP.

Thanks for following this guide through to the end. If you spotted any issues with this guide then please contact us