Skip to content
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

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

Open
chompy18 opened this issue Jan 13, 2021 · 0 comments
Open

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

chompy18 opened this issue Jan 13, 2021 · 0 comments

Comments

@chompy18
Copy link

chompy18 commented Jan 13, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant