bdunogier / ezplatform-graphql-bundle

GraphQL server for eZ Platform, the open source Symfony CMS.
13 stars 6 forks source link

Implement support for selection field type #35

Closed bdunogier closed 6 years ago

bdunogier commented 6 years ago

On schema generation, the isMultiple field setting must be analyzed, and determine which type is returned: either String or [String]. The resolver uses the Field Definition to get the list of values, and matches them against the value(s) in the Field Value.

Example

{
  content {
    selectionTest {
      singleSelection
      multipleSelection
    }
  }
}
{
  "data": {
    "content": {
      "selectionTest": {
          "singleSelection": "selectedValue",
          "multipleSelection": ["selectedValueOne", "selectedValueTwo"]
        }
      }
    }
  }
}

Open questions

Should the selected value id be exposed as well ?

bdunogier commented 6 years ago

Implemented in master.