Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pagination support to graphql query #113

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

xixas
Copy link
Collaborator

@xixas xixas commented Jan 11, 2024

  • Added Options which currently supports pagination
  1. Use the graphQL playground to test.

Request Query:

query {
  notifications(options: { offset: 85, limit: 2 }) {
    notifications {
      id
      channelType
      data
      deliveryStatus	
      result
    }
    total
  }
}

Or in postman
CURL

curl 'http://localhost:3000/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://localhost:3000' --data-binary '{"query":"query {\n  notifications(options: { offset: 85, limit: 2 }) {\n    notifications {\n      id\n      channelType\n      data\n      deliveryStatus\t\n      result\n    }\n    total\n  }\n}\n"}' --compressed

Response

{
  "data": {
    "notifications": {
      "notifications": [
        {
          "id": 137,
          "channelType": 1,
          "data": {
            "from": "[email protected]",
            "to": "[email protected]",
            "subject": "Test subject",
            "text": "This is a test notification",
            "html": "<b>This is a test notification</b>"
          },
          "deliveryStatus": 4,
          "result": {
            "result": {
              "code": "EAUTH",
              "response": "535 5.7.3 Authentication unsuccessful [MAXP287CA0003.INDP287.PROD.OUTLOOK.COM 2023-11-20T13:30:14.728Z 08DBE90B0606671D]",
              "responseCode": 535,
              "command": "AUTH LOGIN"
            }
          }
        },
        {
          "id": 138,
          "channelType": 1,
          "data": {
            "from": "[email protected]",
            "to": "[email protected]",
            "subject": "Test subject",
            "text": "This is a test notification",
            "html": "<b>This is a test notification</b>"
          },
          "deliveryStatus": 4,
          "result": {
            "result": {
              "code": "EAUTH",
              "response": "535 5.7.3 Authentication unsuccessful [MA0PR01CA0081.INDPRD01.PROD.OUTLOOK.COM 2023-11-20T13:30:48.902Z 08DBE93BD54F8028]",
              "responseCode": 535,
              "command": "AUTH LOGIN"
            }
          }
        }
      ],
      "total": 97
    }
  }
}

@osm-vishnukyatannawar osm-vishnukyatannawar merged commit 5d4a6e2 into main Jan 17, 2024
8 checks passed
@osm-vishnukyatannawar osm-vishnukyatannawar deleted the feat/notification-pagination branch January 17, 2024 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants