aPureBase / KGraphQL

Pure Kotlin GraphQL implementation
https://kgraphql.io
MIT License
298 stars 58 forks source link

Getting "This should never happen" error on incorrect fragment name #189

Open jeggy opened 2 years ago

jeggy commented 2 years ago

When having a GraphQL query like this:

{
  persons {
    nodes {
      id
      ...MyFragment2
    }
  }
}

fragment MyFragment on Person {
  lastName
}

it throws an IllegalArgumentException with the message "This should never happen", coming from here: https://github.com/aPureBase/KGraphQL/blob/main/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/structure/RequestInterpreter.kt#L208

As seen by the query it's a simple mistake and I'm using the incorrect fragment name, so a proper error would be much appreciated.