{"id":26920793,"url":"https://github.com/graphql-java-kickstart/graphql-spring-webclient","last_synced_at":"2025-04-09T06:09:58.741Z","repository":{"id":37023350,"uuid":"250185292","full_name":"graphql-java-kickstart/graphql-spring-webclient","owner":"graphql-java-kickstart","description":"Reactive GraphQL client for consuming GraphQL APIs from a Spring Boot application.","archived":false,"fork":false,"pushed_at":"2025-03-25T12:45:12.000Z","size":505,"stargazers_count":98,"open_issues_count":16,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T22:50:23.601Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphql-java-kickstart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-26T07:05:50.000Z","updated_at":"2025-02-27T01:17:09.000Z","dependencies_parsed_at":"2024-01-04T16:44:22.612Z","dependency_job_id":"f00ecbbd-3675-459d-ac9f-91820b6a984c","html_url":"https://github.com/graphql-java-kickstart/graphql-spring-webclient","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-java-kickstart%2Fgraphql-spring-webclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-java-kickstart%2Fgraphql-spring-webclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-java-kickstart%2Fgraphql-spring-webclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-java-kickstart%2Fgraphql-spring-webclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-java-kickstart","download_url":"https://codeload.github.com/graphql-java-kickstart/graphql-spring-webclient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-01T22:48:32.936Z","updated_at":"2025-04-09T06:09:58.723Z","avatar_url":"https://github.com/graphql-java-kickstart.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL Spring Webclient\n[![Maven Central](https://img.shields.io/maven-central/v/com.graphql-java-kickstart/graphql-webclient-spring-boot-starter.svg)](https://maven-badges.herokuapp.com/maven-central/com.graphql-java-kickstart/graphql-webclient-spring-boot-starter)\n![Publish snapshot](https://github.com/graphql-java-kickstart/graphql-spring-webclient/workflows/Publish%20snapshot/badge.svg)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=graphql-java-kickstart_graphql-spring-webclient\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=graphql-java-kickstart_graphql-spring-webclient)\n[![GitHub contributors](https://img.shields.io/github/contributors/graphql-java-kickstart/graphql-spring-webclient)](https://github.com/graphql-java-kickstart/graphql-spring-webclient/graphs/contributors)\n[![Discuss on GitHub](https://img.shields.io/badge/GitHub-discuss-orange)](https://github.com/graphql-java-kickstart/graphql-spring-webclient/discussions)\n\n\nReactive GraphQL client for consuming GraphQL APIs from a Spring Boot application.\nProvides OAuth2 authorization through configuration.\n\n## Getting started\n\nAdd the starter to your project.\n\nWhen using Maven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.graphql-java-kickstart\u003c/groupId\u003e\n  \u003cartifactId\u003egraphql-webclient-spring-boot-starter\u003c/artifactId\u003e\n  \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nWhen using gradle:\n```groovy\nimplementation \"com.graphql-java-kickstart:graphql-webclient-spring-boot-starter:2.0.0\"\n```\n\nConfigure at least the URL of the GraphQL API to consume:\n```yaml\ngraphql:\n  client:\n    url: https://graphql.github.com/graphql\n```\n\nThe starter creates a Spring bean of type `GraphQLWebClient` that you can use in your\nclasses to send queries. A simplified example might look like this:\n\n```java\n@Component\nclass MyClass {\n  \n  private final GraphQLWebClient graphQLWebClient;\n  \n  MyClass(GraphQLWebClient graphQLWebClient) {\n    this.graphQLWebClient = graphQLWebClient;\n  }\n  \n  String helloWorld() {\n    GraphQLRequest request = GraphQLRequest.builder().query(\"query { hello }\").build();\n    GraphQLResponse response = graphQLWebClient.post(request).block();\n    return response.get(\"hello\", String.class);\n  }\n}\n```\n\n### Using latest Snapshots\n\nYou can use the latest Snapshots by configuring the Snapshot repository, see https://graphql-java-kickstart.github.io/servlet/#using-the-latest-development-build.\n\n\n## Configuration\n\nThe following tables list the configurable properties of the GraphQL Spring Webclient and their default values.\nThese properties are configured with the prefix `graphql.client`, e.g. the property listed in the table as `url` \nshould be defined as `graphql.client.url` in your Spring Boot configuration files.\n\n| Property | Description |\n|----------|-------------|\n| `url` | Full URL of the GraphQL API to connect to, e.g. https://graphql.github.com/graphql |\n| `oauth2.client-id` | OAuth2 client id |\n| `oauth2.client-secret` | OAuth2 client secret |\n| `oauth2.token-uri` | Token URI of the identity provider |\n| `oauth2.authorization-grant-type` | By default the grant type `client_credentials` is used |\n| `retry.strategy` | The retry strategy to auto configure for the `WebClient` _(possible values are `none`, `backoff`, `fixed_delay`, `indefinitely`, `max` and `max_in_row`)_. Default is `none`. |\n| `retry.backoff.max-attempts` | The maximum number of retry attempts to allow _(only used when `retry.strategy` = `backoff`)_. |\n| `retry.backoff.min-backoff` | The minimum duration for the first backoff _(only used when `retry.strategy` = `backoff`)_. Default is `0`. |\n| `retry.backoff.max-backoff` | The maximum duration for the exponential backoffs _(only used when `retry.strategy` = `backoff`)_. Default is `Duration.ofMillis(Long.MAX_VALUE)`. |\n| `retry.fixed-delay.max-attempts` | The maximum number of retry attempts to allow _(only used when `retry.strategy` = `fixed_delay`)_. |\n| `retry.fixed-delay.delay` | The duration of the fixed delays between attempts _(only used when `retry.strategy` = `fixed_delay`)_. |\n| `retry.max.max-attempts` | The maximum number of retry attempts to allow _(only used when `retry.strategy` = `max`)_. |\n| `retry.max-in-row.max-attempts` | The maximum number of retry attempts to allow in a row _(only used when `retry.strategy` = `max_in_row`)_. |\n\n### Max in memory size\n\nIn case you need to work with large responses you might run into the following error:\n```\nExceeded limit on max bytes to buffer : 262144\n```\nIn that case starting with version 0.1.2 you can use the default Spring Boot configuration property to configure\nthe max in memory size to use:\n```properties\nspring.codec.max-in-memory-size=10MB\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-java-kickstart%2Fgraphql-spring-webclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-java-kickstart%2Fgraphql-spring-webclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-java-kickstart%2Fgraphql-spring-webclient/lists"}