Hi  Team,
Here is my design document to implement the GraphQL Subscription support
for WSO2 API Manager via web sockets.

GraphQL Subscription support for WSO2 API Manager via websockets


   1.

   Introduction


The current WSO2 API Manager provides the ability to manage operations of
the GraphQL API. The root types of the GraphQL schema are the query,
mutation and subscription type, which are the three types of operations
that can be used to run requests from a GraphQL schema.


   -

   Query - Allows to fetch data.
   -

   Mutation - Allows to create and modify the server side data.
   -

   Subscription - Allows a server to send data to its clients when a
   specific event happens.


But current WSO2 API Manager is supported only for GraphQL queries and
mutations features. In current implementation, HTTP is used to fetch and
modify the server side data. So using this current WSO2 API manager,
clients are not able to handle the real-time updates in GraphQL APIs. To
get the real-time updates, it should be created using protocols like
websockets.The existing WSO2 API manager should be upgraded by implementing
this real-time capability. So the existing issue can be eliminated by
implementing GraphQL subscription support for WSO2 API Manager via
websockets.


   1.

   Implementation Approach



   -

   When creating the GraphQL API, first check the GraphQL schema to clarify
   whether the subscription type is available or not.
   -

   If there was no subscription type in the schema, There was nothing to
   modify the existing implementation.
   -

   If there is a subscription type operation, then have to initialize the
   websocket endpoint to execute the subscription operation.
   -

   Then queries and mutation type operations can access the http endpoint
   to call the GraphQL backend and the subscription type operations can access
   the ws endpoint to get the real time updates of the GraphQL backend.


Flow Chart



Design Diagram





I would like to get some feedback on this design.

Thank you.


-- 

*Raveesha Rukshani*| Intern | WSO2 Inc.

(m) +94714998611 | (e) [email protected] <http://wso2.com/signature>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to