You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@s2graph.apache.org by "Daewon Jeong (JIRA)" <ji...@apache.org> on 2017/12/18 09:58:00 UTC

[jira] [Commented] (S2GRAPH-172) Suggest to implement GraphQL as standard web interface for S2Graph.

    [ https://issues.apache.org/jira/browse/S2GRAPH-172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294736#comment-16294736 ] 

Daewon Jeong commented on S2GRAPH-172:
--------------------------------------

[~steamshon]

Let's take the label in S2Graph README.md as an example.

The label's schema looks like this and I'll take an example with a simple query that brings people who are my friends.

- label schema
```json
{
  "label": "friends",
  "srcServiceName": "KakaoFavorites",
  "srcColumnName": "userName",
  "srcColumnType": "string",
  "tgtServiceName": "KakaoFavorites",
  "tgtColumnName": "userName",
  "tgtColumnType": "string",
  "isDirected": "false",
  "indices": [],
  "props": [],
  "consistencyLevel": "strong"
}
'
```

The query provided by S2Graph is as follows.
This query is very powerful but not user-friendly (writing JSON manually is very painful)

- as is: S2Graph Query
```
{
    "select": ["to"],
    "srcVertices": [
        {
            "columnName": "userName",
            "serviceName": "KakaoFavorites",
            "id": "daewon"
        }
    ],
    "steps": [
        {
            "step": [
                {
                    "direction": "out",
                    "label": "friends",
                    "offset": 0,
                    "limit": 1000
                }
            ]
        }
    ]
}
```

If use GraphQL, it can change as follows. (I do not know the exact implementation yet)

- to be: GraphQL Query 

```
{
  kakao_ad(target_key: "daewon") {
    kakao_moment_ads_bulkload(offset: 0, limit: 100) {
      name      
    }
    kakao_moment_ads_bulkload(offset: 0, limit: 100) {
      name      
    }
  }
}
```

If GraphQL is successfully applied to S2Graph, 
We can escape the painful task of writing JSON with the help of a great client like GraphiQL [http://graphql.org/swapi-graphql/].

I also think that S2Graph will work very well with GraphQL because it has the document Schema.

GraphQL is very schema-friendly.

> Suggest to implement GraphQL as standard web interface for S2Graph.
> -------------------------------------------------------------------
>
>                 Key: S2GRAPH-172
>                 URL: https://issues.apache.org/jira/browse/S2GRAPH-172
>             Project: S2Graph
>          Issue Type: New Feature
>            Reporter: Daewon Jeong
>            Priority: Minor
>              Labels: features
>
> GraphQL Support
> Suggest to implement GraphQL as standard web interface for S2Graph.
> S2Graph's query is implemented in its own way, it provides many features, but it is not easy to learn this query from the user.
> I would like to hear how you can provide the GraphQL function for convenient use of S2Graph.
> p.s: Graph QL has nothing to do with Graph DataBase, and Graph search is not the purpose of GraphQL.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)