diff --git a/CHANGELOG.md b/CHANGELOG.md index b21f05041..cbdfca663 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # Change Log +## 2025-03-20 - Runtime 0.17.6 + +- fix: correct json in introspection query results [#798](https://github.com/hypermodeinc/modus/pull/798) + ## 2025-03-19 - Runtime 0.17.5 - fix: embed runtime version with correct path [#796](https://github.com/hypermodeinc/modus/pull/796) diff --git a/runtime/graphql/graphql.go b/runtime/graphql/graphql.go index 4f0a89f73..9241ccb78 100644 --- a/runtime/graphql/graphql.go +++ b/runtime/graphql/graphql.go @@ -169,7 +169,7 @@ func handleGraphQLRequest(w http.ResponseWriter, r *http.Request) { // to replace the null with an empty array. if ok, _ := gqlRequest.IsIntrospectionQuery(); ok { if q := gjson.GetBytes(response, `data.__schema.types.#(name="Query")`); q.Exists() { - if f := q.Get("fields"); f.Type == gjson.Null { + if f := q.Get("fields"); f.Exists() && f.Type == gjson.Null { response[f.Index] = '[' response[f.Index+1] = ']' response = append(response[:f.Index+2], response[f.Index+4:]...)