ballerina-platform/ballerina-library

Add Datasource Support for GraphQL Context

Closed this issue · 1 comments

Description:

In most GraphQL services, there should be some sort of data source to connect to. For some GraphQL services, there is even more than one data source. Therefore, handling the datasources throughout the GraphQL service is a nice-to-have feature.

Some of the popular GraphQL implementations support defining and accessing the datasource through the GraphQL context. In Ballerina, the users can do the same, but given the Ballerina type system, it is better to provide separate, type-safe, APIs to add and retrieve relevant data sources. In Ballerina's case, the data source should be a client object.

After some research, it seems like this is a redundant issue since the Datasource is just another abstraction. Therefore, we do not need this, but to improve the user experience, we can implement the #4108