aPureBase / KGraphQL

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

Fragment on Query still not working #174

Open ima9dan opened 2 years ago

ima9dan commented 2 years ago

When having something like:

query{
  ...countrysightings
}

fragment countrysightings on Query{
  topCountrySightings{
    country
    numOccurrences
    state
  }
}

Intended outcome: We should get the same result as if we called

{
  "data": {
    "topCountrySightings": [
      {
        "country": "us",
        "numOccurrences": 8021,
        "state": ""
      },
      {
        "country": "",
        "numOccurrences": 860,
        "state": ""
      },
      {
        "country": "ca",
        "numOccurrences": 293,
        "state": ""
      },
      {
        "country": "gb",
        "numOccurrences": 69,
        "state": ""
      },
      {
        "country": "au",
        "numOccurrences": 46,
        "state": ""
      },
      {
        "country": "de",
        "numOccurrences": 9,
        "state": ""
      }
    ]
  }
}

Actual outcome: An internal server error occurs. The above mentioned query also works in Playground so it should not be a GraphQL syntax issue.