spring-projects / spring-projects/spring-graphql

How to make a graphql request for persisted queries using HttpGraphQlClient in spring graphql?

Open
#1,400 3 comments 1 reaction 1 assignee View on GitHub

@bclozel is already working on this.

Since Dec 3, 2025.

status: waiting-for-triage
Dominant language
Java
Stars
1.6k
Forks
336
PR merge metrics
No merged PRs in 30d

Description

I have spring boot graphql server side and spring graphql client side applications. The client graphql queries are persisted in graphql-server-side. Now from the graphql-client-side application, how to make the graphql requests using the sha256 hash of the graphql query using HttpGraphQlClient?

I know that we pass the sha256 hash in the 'extensions' key of the request body. But to access RequestSpec's extensions() method, GraphQlClient contract exposes two methods RequestSpec document(String document) and RequestSpec documentName(String document). One way it to do is graphQlClient.document(null).extensions(Map.of(...)).executeSync(), but the parameter for document() method is not nullable so that doesn't work.

Basically, how to make a graphql request with the hash of a persisted query using HttpGraphQlClient? Or is this not supported yet?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.