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

Prettyify the AST before printing #4

Open
mattkrick opened this issue Feb 8, 2022 · 0 comments
Open

Prettyify the AST before printing #4

mattkrick opened this issue Feb 8, 2022 · 0 comments

Comments

@mattkrick
Copy link
Member

graphql-js print doesn't dedupe fields. this is because it doesn't really matter because the receiving server is going to handle it just fine.

for our use case, it makes sense to deduplicate things because things can be repeated many, many times over.
see graphql/graphql-js#2342

for example, check out this:

    issue(number: 5821) {
      __typename
      ... on Issue {
        __typename
        title
        number
      }
      id
      __typename
      id
      __typename
      id
      __typename
      ... on Issue {
        __typename
        repository {
          nameWithOwner
          id
        }
      }
      id
      __typename
      id
      __typename
      ... on Issue {
        __typename
        ...PokerEstimateHeaderCardGitHub_issue
      }
      id
    }
  }

look at them dupes!
i think these are generally caused by relay, but need to confirm.

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