spring-projects / spring-graphql

Spring Integration for GraphQL
https://spring.io/projects/spring-graphql
Apache License 2.0
1.52k stars 300 forks source link

Avoid `graphql.AssertException` for persisted query #930

Closed rstoyanchev closed 6 months ago

rstoyanchev commented 6 months ago

For persisted queries, the request could look like this:

 {
     "extensions":{
        "persistedQuery":{
           "version":1,
           "sha256Hash":"ecf4edb46db40b5132295c0291d62fb65d6759a9eedfa4d5d612dd5ec54a6b38"
          }
      }
}

As there is no "query", setting the query on ExecutionInput results in a "query can't be null" AssertException.

We should use PersistedQuerySupport#PERSISTED_QUERY_MARKER as the query in that case.