Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraphQL Java client for Spring Boot

I need to call GraphQL API (Shopify Storefront API) from my Spring Boot app and I can`t find any source where described which libraries I can use for that. Can you suggest library or can someone describe how I can setup Apollo Client for my Spring Boot app and run query/mutations from my Spring Boot app to Shopify. Your help is appreciated.

like image 577
Arman Tumanyan Avatar asked Mar 26 '18 16:03

Arman Tumanyan


People also ask

Can I use GraphQL with spring boot?

The Spring Boot GraphQL Starter offers a fantastic way to get a GraphQL server running in a very short time. Combined with the GraphQL Java Tools library, we need only write the code necessary for our service.

Can I use GraphQL with Java?

You can use the GraphQL SPQR in pretty much any Java environment, even with Micronaut.

Is GraphQL client or server?

A GraphQL server is a server-side implementation of the GraphQL spec. In other words, a GraphQL server exposes your data as a GraphQL API that your client applications can query for data. These clients could be a single page application, a CMS like Drupal, a mobile app, or almost anything.

Which of the following clients use GraphQL?

1. Apollo-Client. Apollo-Client is a comprehensive JavaScript library used for managing local and remote data with GraphQL. It has many benefits like state management, fetching, caching, and modifying application data.


1 Answers

You could use Apollo Android, which the documentation says is not just for Android, but any Java/Kotlin application.

You could also just go old-school and use HTTP POSTS from Spring and handle the response yourself (but you would lose type-safety features).

like image 180
banncee Avatar answered Sep 23 '22 14:09

banncee