Users will be able to choose to use a RESTful/HTTP API as a data source, essentially converting a RESTful API into GraphQL with Federation 2 support.
Defining The Data Source
The user will first define the data source at the top level of the config.
[[service.data_sources]]
[service.data_sources.HTTP]
name = "business"
url = "https://jsonplaceholder.typicode.com/"
[[service.data_sources.HTTP.default_headers]]
header = "Authorization"
value = "Bearer token_123456789"
By default, the same endpoint will be used for each resolver. HTTP Method will change depending on resolver functionality.
Users will be able to adjust endpoint per entity.
[service.entities.data_source]
from = "business"
endpoint = "/todos"
...
[service.entities.data_source]
from = "business"
endpoint = "/notes"
Users will be able to adjust endpoint per resolver. They can use properties defined in the entity or custom input as variables for query params. Users will be able to adjust inputs for each resolver.
[service.entities.data_source]
from = "todos"
endpoint = "/todos"
[[service.entities.data_source.resolvers]]
[service.entities.data_source.resolvers.GetOne]
endpoint = "/:id"
[service.entities.data_source.resolvers.CreateOne]
[[service.entities.data_source.resolvers.CreateOne.fields]]
...Field Type
Users will be able to choose to use a RESTful/HTTP API as a data source, essentially converting a RESTful API into GraphQL with Federation 2 support.
Defining The Data Source