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

Fix renaming input fields that are nested within lists using @rename #1166

Merged
merged 3 commits into from
Jan 23, 2020

Conversation

enzonotario
Copy link
Collaborator

@enzonotario enzonotario commented Jan 21, 2020

  • Added or updated tests
  • Added Docs for all relevant versions
  • Updated CHANGELOG.md

Resolves #1167

Changes

@rename could be used within nested inputs, but failed if the input was nested within a list.

The following example was broken but now works:

type Query {
    foo(
        input: [FooInput]
    ): Boolean @mock
}

input FooInput {
    baz: String @rename(attribute: "bar")
}

Breaking changes

None.

@enzonotario enzonotario changed the title Add failling test [failling-test] Can't rename nested inputs Jan 21, 2020
@spawnia spawnia changed the title [failling-test] Can't rename nested inputs Fix renaming input fields that are nested within lists using @rename Jan 23, 2020
@spawnia spawnia added the bug An error within Lighthouse label Jan 23, 2020
@spawnia
Copy link
Collaborator

spawnia commented Jan 23, 2020

Thanks @enzonotario for bringing up this bug and adding the failing test case. That is always a great starting point.

@spawnia spawnia merged commit 0747ec5 into master Jan 23, 2020
@spawnia spawnia deleted the nested-rename-input branch January 23, 2020 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error within Lighthouse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@rename directive doesn't work in nested inputs
2 participants