New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development branch, for review #49

Merged
merged 15 commits into from Nov 5, 2018

Conversation

Projects
None yet
1 participant
@bdunogier
Owner

bdunogier commented Oct 27, 2018

Living branch, in a stacked diffs approach.

Each commit has its own extensive description.

bdunogier added some commits Oct 27, 2018

Automated schema config, and reorganized endpoints
There is no need to configure the overblog_graphql extension in the app's config anymore.

In addition, the endpoints have been reorganized. Even though /repository is kept for BC,
the domain one is moved to the root. It also has an _repository field that gives access
to the repository's API, with contentTypes, sections...
Return content using the siteacces language priority
All the repository's services used to resolve domain content will now use the siteaccess
aware services. Changing siteaccess is done using the usual way, either by changing domain,
or by prefixing the URI: /fr/graphql will use the fr siteaccess if the configuration matches.

WARNING: content will now be returned with the language settings from the _default_
siteaccess. It may be necessary to change to a new one.
Mapped email, country fields types to String (#41, #40)
```
{
  content {
    type {
      email
      country
    }
  }
}
```
Removed the intermediary 'authors' from author field value (#37)
```
{
  test {
    someType {
      author {
        name
        email
      }
    }
  }
}
```

Field definitions aimed to hold multiple authors should be named as plural for consistency.
Expose content type group from domain roots (#51)
Also adds preliminary support for field definitions settings and constraints

```
{
  content {
    _type {
      names
      creator { name }
      creationDate { format: format(pattern: "d/m/Y")}
    }
    articles {
      title
    }
```
Added debug features to generate command
Use --dry-run to echo the yaml definition without writing.
Use --include=<type> to limit output to a type. Can be repeated.
Added content types to generated domain (#51)
types can be obtained from the "_type" field of DomainGroup items. They give access
to the type's info ("_info"), as well as field definitions, indexed by their identifier.
Field definition objects are typed when the type has specific settings or constraints:

```
{
  content {
    _types {
      article {
        _info { id name }
        title {
          name
          fieldTypeIdentifier
          constraints { minLength maxLength }
        }
        body {
          fieldTypeIdentifier
        }
      }
    }
  }
}
```

More Types of Fields Definitions
Generate the list of Content Types to an enum type (#22)
Exposed as part of the schema when inputing ContentSearchQuery.ContentTypeIdentifier:

```
{
  _repository {
    searchContent(query: {ContentTypeIdentifier: article}) {
      name
    }
  }
}
```
Improved relation list field schema
Depending on the selectable content types & selection limit, the field yields a different type:
- one type, one item: one item of the constrained type ("File")
- one type, multiple items: a list of the constrained type ("[Files]")
- multiple types, single item: one DomainContent
- multiple types, multiple items: a list of DomainContent

```
{
  test {
    relationTest(id: 248) {
      singleFileRelation {
        name
        file { uri }
      }
      multiFilesRelation {
        name
        file { uri }
      }
      multiTypesSingleItem {
        ... on SomeDomainType {}
        ... on SomeOtherDomainType {}
      }
      multiTypesMultiItems {
        ... on SomeDomainType {}
        ... on SomeOtherDomainType {}
      }
    }
  }
}
```
Implemented ImageAsset field support
ImageAsset fields will behave like a regular image.
Improved selection field resolution (#35)
Depending on the field definition isMultiple setting, selection fields will yield either a String (single), or an array of String (multiple):

```
{
  "data": {
    "test": {
      "selectionTest": {
        "singleSelection": "Lord Vetinari",
        "multipleSelection": [
          "Lord Vetinari",
          "Vimes",
          "Granny Weatherwax"
        ]
      }
    }
  }
}
```

@bdunogier bdunogier merged commit 7e942ca into master Nov 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment