这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@rakeshkky
Copy link
Member

Description

What component does this PR affect?

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Requires changes from other components? If yes, please mark the components:

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Related Issue

close #1040

Solution and Design

Addition distinct_on argument for GraphQL queries.

   employee (
     distinct_on: [employee_select_column]
     order_by: [employee_order_by]
   ): [employee]!

   #select column enum type for "employee" table
   enum employee_select_column {
     id
     name
     department
     salary
   }

Example query:-

      query {
        employee(
          distinct_on: [department]
          order_by: [{department: asc}, {salary: desc}]
        ){
          id
          name
          department
          salary
        }
      }

Response:-

     {
       "data": {
         "employee": [
           {
             "id": 5,
             "name": "Kamila",
             "department": "Engineering",
             "salary": 4325
           },
           {
             "id": 4,
             "name": "Damien",
             "department": "Product",
             "salary": 3124
           },
           {
             "id": 7,
             "name": "Rickard",
             "department": "Services",
             "salary": 2223
           }
         ]
       }
     }

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update
  • Community content

Checklist:

  • I have read the contributing guide and my code conforms to the guidelines.
  • This change requires a change in the documentation.
  • I have updated the documentation accordingly.
  • I have added required tests.

@rakeshkky rakeshkky requested a review from 0x777 November 22, 2018 10:46
@rakeshkky rakeshkky self-assigned this Nov 22, 2018
@rakeshkky rakeshkky added s/ok-to-merge Status: This pull request can be merged to master c/server Related to server labels Nov 22, 2018
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-1099.herokuapp.com

@0x777 0x777 merged commit 58fe579 into hasura:master Nov 23, 2018
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-1099.herokuapp.com is deleted

hasura-bot pushed a commit that referenced this pull request Sep 11, 2024
<!-- The PR description should answer 2 important questions: -->

### What

In `metadata-resolve`, we raise `issues`, and then decide later if those
are `warnings` or `errors`. This fixes some naming and comments to make
that clearer.

V3_GIT_ORIGIN_REV_ID: 9d13de42a29dbdc00945468b3d9c843fff9099f7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/server Related to server s/ok-to-merge Status: This pull request can be merged to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support DISTINCT ON

3 participants