Skip to content

Allow rename transform to rename multiple types into a single one #1415

Open
@chompy18

Description

@chompy18

Based on #1414 , one way to tackle the fragments issue is to allow the rename transform to rename multiple type into a single one - that will allow a manual process of renaming only the types that match and use fragments on the resulting type.
I saw regex can be used, but that might also affect unrelated types so Translations(.*) will affect Translations, TranslationsListListItem and TranslationsInput, while we only want to affect Translations, TranslationsListListItem .

So the SDL in #1414 could rename be presented as:

type Query {
  # get translations
  #
  # Equivalent to GET /translations/{translation_id}
  getTranslationById(translationId: String): Translation

  # get translations list
  #
  # Equivalent to GET /translations/list
  getTranslationsList(
    # Auto-generated argument that limits the size of returned list of objects/list, selecting the first `n` elements of the list
    limit: Int
  ): [Translation]
}

type Translation {
  displayName: DisplayName
  id: String
  key: String
  platform: [String]
  title: String
}

type DisplayName {
  en: String
  he: String
}

Another issue, is that currently it is not possible to rename into an existing type, but the above should basically allow to rename TranslationsListListItem to Translation even though it exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions