Android Question Any Graphql client library?

hibrid0

Active Member
Licensed User
Longtime User
Hi, I my friends. I want to know if exist any GraphQL library for B4a, B4J.
Or any example. I'm learning it and migrating from API Rest.
 
Possible to use GraphQL API calls inside B4X by translating it in to Curl version and use it with POST request

GraphQL Query example:
query{
employees{
id
name
}
}



Curl example:

curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ employees{ id name }}" } \
http://localhost:4000
 
Upvote 0
Hi, I my friends. I want to know if exist any GraphQL library for B4a, B4J.
Or any example. I'm learning it and migrating from API Rest.

found something? I have the same need
 
Upvote 0
Upvote 0
you can do a GET request!
If you need to send Authorization Bearer, remember to send it from header

B4X:
Dim job As HttpJob
job.Initialize("", Me)
job.Download($"https://www.../graphql?query={yourQuery}"$)
job.GetRequest.SetHeader("Content-Type", "application/json")
job.GetRequest.SetHeader("Authorization", $"Bearer ${access_token}"$)
job.GetRequest.SetHeader("Accept", "application/json")
 
Upvote 0
Back
Top