artsy / metaphysics

Artsy's GraphQL API
MIT License
360 stars 89 forks source link

feat(art advisor): expose experiments in homeView response #6160

Closed anandaroop closed 2 weeks ago

anandaroop commented 2 weeks ago

https://artsyproduct.atlassian.net/browse/ONYX-1361

Co-authored-by: @dblandin Co-authored-by: @olerichter00

Adds the ability to expose currently running experiments and variants in the homeView response.

Request

{
  homeView {
    experiments {
      name
      variant
    }
    sectionsConnection(first: 3) {
      edges {
        node {
          internalID
        }
      }
    }
  }
}

Response

{
  "data": {
    "homeView": {
      "experiments": [
        {
          "name": "onyx_experiment_home_view_test",
          "variant": "control"
        }
      ],
      "sectionsConnection": {
        "edges": [
          {
            "node": {
              "internalID": "home-view-section-tasks"
            }
          },
          {
            "node": {
              "internalID": "home-view-section-latest-activity"
            }
          },
          {
            "node": {
              "internalID": "home-view-section-new-works-for-you"
            }
          }
        ]
      }
    }
  }
}