Uploaded image for project: 'S2Graph'
  1. S2Graph
  2. S2GRAPH-234

Add a meta field(source_id, target_id) to GraphQL Edge Query (label)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: To Do
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • s2graphql
    • None

    Description

      Add a meta field(source_id, target_id) to GraphQL Edge Query (label)

      In Vertex Query(ServiceColumn) there is a fixed field called id.
      However, there is only a ServiceColumn for the connected source/target in the Edge (label).

      Therefore, in order to access the Source/Target ServiceColumn id of an Edge at the time of GraphQL query,
      it is necessary to access in the same format as the corresponding ServiceColumn

      { id }

      This is logically very clear, but it is inconvenient in actual use.

      For more convenient queries, add a meta field to the Edge such as _source, _target, and so on.

      The `source_id` indicates the id value of the Source ServiceColumn.
      The `target_id` indicates the id value of the Target ServiceColumn.

      If the above applies, you can query all of them in the following two ways.

       as is

      {
        s2graph {
          User(id: "daewon") {
            id
            Like(limit: 10) {
              Book {
                id
              }
            }
          }
        }
      }
      

      to be

      {
        s2graph {
          User(id: "daewon") {
            id
            Like(limit: 10) {      
              target_id
            }
          }
        }
      }
      

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            daewon Daewon Jeong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: