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

Daewon Jeong commented on S2GRAPH-180:
--------------------------------------

h1. Summary

I was a little more accustomed to the GraphQL interface, and I thought I wanted 
to implement the API in a more accurate form.

So I will change some APIs like below and implemented the unimplemented 
functions.

[~steamshon] Please comment on the API.

h1. API changed
h3. createLabel
 # as-is
 You can cause a mistake because you specify the input value yourself in 
`sourceService / targetService`

{code:javascript}
mutation {
  createLabel(
    name: "friends",
    sourceService: {
      name: s2graph,
      columnName: "user",
      dataType: string
    },
    targetService: {
      name: s2graph,
      columnName: "user",
      dataType: string
    }    
  ) {
    isSuccess    
  }
}
{code}
 # to-be
 `sourceService / targetService` can be entered so that the user does not make 
a mistake value.

{code:java}
mutation {
  Management {
    createLabel(
      name: "friends",      
      sourceService: {      
        s2graph: {
          columnName: user
        }
      },
      targetService: {
        s2graph: {
          columnName: user          
        }
      }     
    ) {
      isSuccess
    }
  }
}
{code}
h1. Mutation API List

We will implement the Management API in the following form.
h2. createService
{code:java}
mutation {
  Management {
    createService(
        name: "s2graph", 
      compressionAlgorithm: gz
    ) {
      isSuccess
      message
    }
  }
}
{code}
h2. createServiceColumn
{code:java}
mutation {
  Management {
    createServiceColumn(
      serviceName: s2graph
      columnName: "user"
      columnType: string
      props: {
        name: "age"
        dataType: int
        defaultValue: "0"
        storeInGlobalIndex: true      
      }
    ) {
      isSuccess
    }
  }
}
{code}
h2. addPropsToServiceColumn
{code:java}
mutation {
  Management {
    addPropsToServiceColumn(
      serviceName: {
        s2graph: {
          columnName: user
          props: {
            name: "gender"
            dataType: string
            defaultValue: "-"
            storeInGlobalIndex: true
          }
        }
      }
    ) {
      isSuccess
      object {
        props {
          name
        }
      }
    }
  }
}
{code}
h2. createLabel
{code:java}
mutation {
  Management {
    createLabel(
      name: "friends",      
      sourceService: {      
        s2graph: {
          columnName: user
        }
      },
      targetService: {
        s2graph: {
          columnName: user          
        }
      },
      props: {
       name: "score",
        dataType: string,
        defaultValue: ""
        storeInGlobalIndex: true
      }
    ) {
      isSuccess
    }
  }
}
{code}
h2. addPropsToLabel
{code:java}
mutation {
  Management {
    addPropsToLabel(
      labelName: {
        friends: {
          props: {
            name: "score"
            dataType: float
            defaultValue: "0"
            storeInGlobalIndex: false
          }
        }
    }) {
      isSuccess
    }
  }
}
{code}
h2. deleteLabel
{code:java}
mutation {
  Management {
    deleteLabel(name: friends) {
      isSuccess
    }
  }
}
{code}
h2. deleteServiceColumn
{code:java}
mutation {
  Management {
    deleteServiceColumn(
      serviceName: {
        s2graph: {
          columnName: user            
        }
      }) {
      isSuccess
    }
  }
}
{code}

> Implement missing Management API
> --------------------------------
>
>                 Key: S2GRAPH-180
>                 URL: https://issues.apache.org/jira/browse/S2GRAPH-180
>             Project: S2Graph
>          Issue Type: Sub-task
>            Reporter: Daewon Jeong
>            Assignee: Daewon Jeong
>            Priority: Minor
>
> Currently only some functions are implemented (ex: Create)
> Must add remaining API
> List to implement
>   - Service
>   - ServiceColumn
>     - Props
>   - Label
>     - Props



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to