(+adding Architecture Group)

On Fri, Oct 4, 2019 at 2:03 PM Hiranya Abeyrathne <[email protected]> wrote:

> Hi,
>
> If we are going to support Graphql APIs in MGW, we have to facilitate a
> rest endpoint that serves Graphql schema and other API details related to
> [1], same as we do using swagger. Therefore, I have done some POCs to check
> whether there is any possibility to store all the (API level, Resource
> Level) details inside the Graphql schema as their specification defines the
> features such as additional types and directive. Here we initially thought
> to provide the facility as follows.
>
> *Eg :- *
> API level - additional type
> *type x_wso2_endpoints {*
> *   endpoint: string*
> *}*
>
> Resource Level - directives.
> *directive @wso2 on FIELD_DEFINITION*
> *type Query {*
> *  allLinks: [Link] @wso2(scope:'scope1', throttlePolicy: 'unlimited' ,
> security: true)*
> *}*
>
> But, the above approach has few complexities like the following.
> 1. We have to regenerate a new schema creating a set of graphqlObjectType
> objects adding previous objects since their parser is immutable to do the
> modification.
> 2. When the operation contains many directives itself, adding a new @wso2
> directive against every operation makes the process cumbersome.
>
> Therefore, we're going to follow the below approach.
> MGW will be doing an initial rest call to get an API object. Then it sends
> the next call by checking the type (It might be /swagger or  /graphql with
> @param IsAllowMapping=true). If it asks about graphql API, we will do the
> response with graphql schema and other details.
>
> In order to do that, once the support for graphql DeveloperFirst approach
> in MGW is implemented, we will be able to finalize the required mapping
> which should be given by APIM and do the modification in rest API level
> according to it in a future release.
>
> [1] https://docs.wso2.com/display/MG301/Supported+OpenAPI+Extensions
>
> Thanks!
> Hiranya Abeyrathne
> Software Engineer,
>
> *WSO2, Inc. *
>
> lean. enterprise. middleware
> Mob: +94 70210 8657
> LinkedIn: https://www.linkedin.com/in/hiranya-kavishani/
>
> <http://wso2.com/signature>
>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to