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

Invalid path/type on unknown nodes #76

Closed
Maximilien-R opened this issue Jan 14, 2019 · 0 comments
Closed

Invalid path/type on unknown nodes #76

Maximilien-R opened this issue Jan 14, 2019 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Maximilien-R
Copy link
Member

When requesting unknown fields on a GraphQL query, the path contained on errors doesn't seems to be properly re-calculated. Also, the type from the error message is invalid too:

type UserStatsViews {
  total: Int
}

type UserStats {
  views: UserStatsViews
}

type User {
  name: String
  stats: UserStats
}

type Query {
  viewer: User
}

Query example:

query {
  viewer {
    name
    stats {
      views {
        total
        unknownField4
      }
      unknownField3
    }
    unknownField2
  }
  unknownField1
}

Result:

{
  "data": null,
  "errors": [
    {
      ...
      "path": [
        "viewer",
        "stats",
        "views",
        "unknownField4"
      ]
    },
    {
      ...
      "path": [
        "viewer",
        "stats",
        "views",
        "unknownField4",
        "unknownField3"
      ]
    },
    {
      ...
      "path": [
        "viewer",
        "stats",
        "views",
        "unknownField4",
        "unknownField3",
        "unknownField2"
      ]
    },
    {
      ...
      "path": [
        "viewer",
        "stats",
        "views",
        "unknownField4",
        "unknownField3",
        "unknownField2",
        "unknownField1"
      ]
    },
  ]
}

The result is different depending on using fragment or not.

@Maximilien-R Maximilien-R added the bug Something isn't working label Jan 14, 2019
@abusi abusi added this to the road-to-v1 milestone Jan 14, 2019
@abusi abusi closed this as completed in #77 Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants