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

Modify ast nodes when transforming schemas #1762

Merged
merged 6 commits into from
Jul 13, 2020

Commits on Jul 13, 2020

  1. Modify ast nodes when transforming schemas

    Each transform should also modify the underlying astnode and extensionASTNodes, if they exist.
    
    Initial change adds ast modification to:
    = RenameTypes
    = TransformCompositeFields
    
    TransformCompositeFields provides implementation for additional transforms:
    = TransformRootFields
    = FilterRootFields
    = RenameRootFields
    = TransformObjectFields
    = FilterObjectFields
    = RenameObjectFields
    = TransformInterfaceFields
    = FilterInterfaceFields
    = RenameInterfaceFields
    
    Still to do:
    = WrapFields (which provides implementation of WrapType)
    = HoistFields
    = PruneSchema
    = TransformInputIbjectFields (which provides implementation of FilterInputObjectFields and RenameInputObjectFields)
    yaacovCR committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    8228467 View commit details
    Browse the repository at this point in the history
  2. Modify ast nodes within TransformInputObjectFields

    as well as implementing transforms FilterInputObjetFields and RenameInputObjectFields
    yaacovCR committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    251c6f3 View commit details
    Browse the repository at this point in the history
  3. MapFields can return undefined to explicitly not map fields

    Alas. This should be called MapFieldNodes, possible can be changes in the next major version.
    yaacovCR committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    85a9d65 View commit details
    Browse the repository at this point in the history
  4. modify ast nodes with WrapFields

    and implementing transform WrapType
    yaacovCR committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    0a39649 View commit details
    Browse the repository at this point in the history
  5. add test for conflicting ast nodes

    see #1747
    yaacovCR committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    dac5314 View commit details
    Browse the repository at this point in the history
  6. mapSchema should update astNodes when possible

    type astNodes can be updated to only include the ast for fields remaining after mapping
    yaacovCR committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    1dd9ae8 View commit details
    Browse the repository at this point in the history