mozilla / normandy

Firefox recipe server
https://wiki.mozilla.org/Firefox/Recipe_Server
Mozilla Public License 2.0
55 stars 46 forks source link

Present arguments and filter objects directly in GraphQL instead of as strings #1873

Open mythmon opened 5 years ago

mythmon commented 5 years ago

Currently, we only expose recipe arguments and filter objects as a raw JSON string in graphql. For example, the query {recipe(id:755){latestRevision{argumentsJson filterObjectsJson}}} results in this response:

{
  "data": {
    "recipe": {
      "latestRevision": {
        "argumentsJson": "{\"slug\": \"rollout-webrender-release-67-1541488\", \"preferences\": [{\"preferenceName\": \"gfx.webrender.all.qualified\", \"value\": true}]}",
        "filterObjectJson": "[{\"channels\": [\"release\"], \"type\": \"channel\"}, {\"versions\": [67], \"type\": \"version\"}, {\"type\": \"bucketSample\", \"input\": [\"\\\"webrender\\\"\"], \"start\": 0, \"count\": 250, \"total\": 1000}]"
      }
    }
  }
}

It would be a lot more helpful to present arguments and filter objects directly as objects instead of strings.

shell1 commented 5 years ago

non-trivial work, but likely want if we start using graphQL anywhere. model arguments