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

Union resolution results in an extra level of nesting #150

Open
jnwng opened this issue Nov 28, 2016 · 0 comments
Open

Union resolution results in an extra level of nesting #150

jnwng opened this issue Nov 28, 2016 · 0 comments

Comments

@jnwng
Copy link

jnwng commented Nov 28, 2016

in a query like this:

query ($bundleName: String!) {
  RapidashAppsV1Resource {
    bundleName(bundleName: $bundleName, limit: 1) {
      elements {
        deploys: deployIds(limit: 10) {
          elements {
            id
            buildId {
              buildDetails {
                ... on org_coursera_rapidash_ProductionBuildDetailsMember {
          -->  org_coursera_rapidash_ProductionBuildDetails {
                    commitId {
                      summary
                      message
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

the nested field org_coursera_rapidash_ProductionBuildDetails is unnecessary since we've already subselected the particular union type via the inline fragment. at this point, we should have resolved the RapidashBuildDetails. ideally this should look like:

buildDetails {
  ... on org_coursera_rapidash_ProductionBuildDetailsMember {
    commitId {
      summary
      message
    }
  }
}

or (stretch goal) renaming the union as well.

buildDetails {
  ... on productionBuildDetails {
    commitId {
      summary
      message
    }
  }
}

/cc @bryan-coursera

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