A simple (yet effective) REST / HTTP to GraphQL router
1.1K
A simple (yet effective) REST / HTTP to GraphQL router
ReGraphQL helps you expose REST/HTTP endpoints and route it to a GraphQL endpoints. Doing this has the following benefits:
It helps you going...
From this
query($person: StarWarsPeople!) {
getPerson(person: $person) {
birthYear
eyeColors
films {
title
}
gender
hairColors
height
homeworld {
name
}
mass
name
skinColors
species {
name
}
starships {
name
}
vehicles {
name
}
}
}
To
GET /persons/{person}
As per version 1.0.1
routes:
- http:
uri: '/persons/{person}'
method: GET
graphql:
endpoint: 'https://swapi.skyra.pw/'
query: |
query($person: StarWarsPeople!) {
getPerson(person: $person) {
birthYear
eyeColors
films {
title
}
gender
hairColors
height
homeworld {
name
}
mass
name
skinColors
species {
name
}
starships {
name
}
vehicles {
name
}
}
}
File starwars.yml
Copy starwars.yml into /tmp/config
Run the service (using Docker Compose)
[sudo] docker-compose up
curl 'http://127.0.0.1:8080/graphql/persons/lukeskywalker' --compressed
Docker image is based on Google's Distroless. The final image is around 11.2MB and packs only the necessary things to run the service.
docker pull eaceto/regraphql:1.0.1
Before contributing to ReGraphQL, please read the instructions detailed in our contribution guide.
ReGraphQL is released under the MIT license. See LICENSE for details.
Created by Ezequiel (Kimi) Aceto.
Content type
Image
Digest
Size
7.8 MB
Last updated
over 4 years ago
docker pull eaceto/regraphql