Skip to content

0.4.0

Latest
Compare
Choose a tag to compare
@hsimah hsimah released this 04 Jan 21:55
· 4 commits to master since this release
7472d35

Enabled group fields!

Groups will generate a new type for the group config. A sample config may look like:

[
  'id' => 'my_group',
  'type' => 'group',
  'name' => 'My Group',
  'graphql_name' => 'MyGroup', // <-- this is the _type_ name and must be unique
  'fields' => [
    [
      'id' => 'group_text_field',
      'type' => 'text',
      'name' => 'Text Field',
     'graphql_name' => 'textField', // <-- this is the _field_ name and must be unique for the group
    ],
    [
      'id' => 'nested_group',
      'type' => 'group',
      'name' => 'Nested Group',
      'graphql_name' => 'MyGroup', // <-- this is the _type_ name and must be unique
      'fields' => [
        [
          'id' => 'nested_text',
          'type' => 'text',
          'name' => 'Nested Text',,
          'graphql_name' => 'textField', // <-- this is the _field_ name and must be unique for the group
        ],
        [
          // this field will not be exposed to the schema
          'id' => 'nexted_checkbox',
          'type' => 'checkbox',
          'desc' => 'Is Active',
        ],
      ],
      'clone' => 1,
      'default_state' => 'expanded',
      'add_button' => 'Add Choice',
    ],
  ],
  'clone' => 1,
  'default_state' => 'expanded',
  'add_button' => 'Add group',
];