band-protocol-backend-assignment GraphQL document

GraphQL specification documentation please look at the /#query-queryUser and /#mutation-addUser for more detailed description or connect to https://green-feather-500032.ap-south-1.aws.cloud.dgraph.io/graphql with graphql playground of your choice e.g. https://graphiql-online.com/graphiql

API Endpoints
https://green-feather-500032.ap-south-1.aws.cloud.dgraph.io/graphql

Queries

aggregateImageObjectStorage

Response

Returns an ImageObjectStorageAggregateResult

Arguments
Name Description
filter - ImageObjectStorageFilter

Example

Query
query aggregateImageObjectStorage($filter: ImageObjectStorageFilter) {
  aggregateImageObjectStorage(filter: $filter) {
    count
    domainMin
    domainMax
    pathMin
    pathMax
  }
}
Variables
{"filter": ImageObjectStorageFilter}
Response
{
  "data": {
    "aggregateImageObjectStorage": {
      "count": 123,
      "domainMin": "xyz789",
      "domainMax": "abc123",
      "pathMin": "abc123",
      "pathMax": "xyz789"
    }
  }
}

aggregateUser

Response

Returns a UserAggregateResult

Arguments
Name Description
filter - UserFilter

Example

Query
query aggregateUser($filter: UserFilter) {
  aggregateUser(filter: $filter) {
    count
    usernameMin
    usernameMax
    profile_image_hashMin
    profile_image_hashMax
    joined_dateMin
    joined_dateMax
  }
}
Variables
{"filter": UserFilter}
Response
{
  "data": {
    "aggregateUser": {
      "count": 987,
      "usernameMin": "xyz789",
      "usernameMax": "abc123",
      "profile_image_hashMin": "xyz789",
      "profile_image_hashMax": "abc123",
      "joined_dateMin": "2007-12-03T10:15:30Z",
      "joined_dateMax": "2007-12-03T10:15:30Z"
    }
  }
}

checkUserPassword

Response

Returns a User

Arguments
Name Description
id - ID!
password - String!

Example

Query
query checkUserPassword(
  $id: ID!,
  $password: String!
) {
  checkUserPassword(
    id: $id,
    password: $password
  ) {
    id
    username
    profile_image_hash
    joined_date
    thirdParty {
      domain
      path
    }
  }
}
Variables
{"id": 4, "password": "xyz789"}
Response
{
  "data": {
    "checkUserPassword": {
      "id": "4",
      "username": "abc123",
      "profile_image_hash": "abc123",
      "joined_date": "2007-12-03T10:15:30Z",
      "thirdParty": ImageObjectStorage
    }
  }
}

getUser

Response

Returns a User

Arguments
Name Description
id - ID
username - String
profile_image_hash - String

Example

Query
query getUser(
  $id: ID,
  $username: String,
  $profile_image_hash: String
) {
  getUser(
    id: $id,
    username: $username,
    profile_image_hash: $profile_image_hash
  ) {
    id
    username
    profile_image_hash
    joined_date
    thirdParty {
      domain
      path
    }
  }
}
Variables
{
  "id": "4",
  "username": "abc123",
  "profile_image_hash": "xyz789"
}
Response
{
  "data": {
    "getUser": {
      "id": "4",
      "username": "abc123",
      "profile_image_hash": "xyz789",
      "joined_date": "2007-12-03T10:15:30Z",
      "thirdParty": ImageObjectStorage
    }
  }
}

queryImageObjectStorage

Response

Returns [ImageObjectStorage]

Arguments
Name Description
filter - ImageObjectStorageFilter
order - ImageObjectStorageOrder
first - Int
offset - Int

Example

Query
query queryImageObjectStorage(
  $filter: ImageObjectStorageFilter,
  $order: ImageObjectStorageOrder,
  $first: Int,
  $offset: Int
) {
  queryImageObjectStorage(
    filter: $filter,
    order: $order,
    first: $first,
    offset: $offset
  ) {
    domain
    path
  }
}
Variables
{
  "filter": ImageObjectStorageFilter,
  "order": ImageObjectStorageOrder,
  "first": 123,
  "offset": 123
}
Response
{
  "data": {
    "queryImageObjectStorage": [
      {
        "domain": "xyz789",
        "path": "xyz789"
      }
    ]
  }
}

queryUser

Response

Returns [User]

Arguments
Name Description
filter - UserFilter
order - UserOrder
first - Int
offset - Int

Example

Query
query queryUser(
  $filter: UserFilter,
  $order: UserOrder,
  $first: Int,
  $offset: Int
) {
  queryUser(
    filter: $filter,
    order: $order,
    first: $first,
    offset: $offset
  ) {
    id
    username
    profile_image_hash
    joined_date
    thirdParty {
      domain
      path
    }
  }
}
Variables
{
  "filter": UserFilter,
  "order": UserOrder,
  "first": 123,
  "offset": 987
}
Response
{
  "data": {
    "queryUser": [
      {
        "id": 4,
        "username": "xyz789",
        "profile_image_hash": "xyz789",
        "joined_date": "2007-12-03T10:15:30Z",
        "thirdParty": ImageObjectStorage
      }
    ]
  }
}

Mutations

addImageObjectStorage

Response

Returns an AddImageObjectStoragePayload

Arguments
Name Description
input - [AddImageObjectStorageInput!]!

Example

Query
mutation addImageObjectStorage($input: [AddImageObjectStorageInput!]!) {
  addImageObjectStorage(input: $input) {
    imageObjectStorage {
      domain
      path
    }
    numUids
  }
}
Variables
{"input": [AddImageObjectStorageInput]}
Response
{
  "data": {
    "addImageObjectStorage": {
      "imageObjectStorage": [ImageObjectStorage],
      "numUids": 123
    }
  }
}

addUser

Response

Returns an AddUserPayload

Arguments
Name Description
input - [AddUserInput!]!
upsert - Boolean

Example

Query
mutation addUser(
  $input: [AddUserInput!]!,
  $upsert: Boolean
) {
  addUser(
    input: $input,
    upsert: $upsert
  ) {
    user {
      id
      username
      profile_image_hash
      joined_date
      thirdParty {
        domain
        path
      }
    }
    numUids
  }
}
Variables
{"input": [AddUserInput], "upsert": false}
Response
{"data": {"addUser": {"user": [User], "numUids": 123}}}

deleteImageObjectStorage

Response

Returns a DeleteImageObjectStoragePayload

Arguments
Name Description
filter - ImageObjectStorageFilter!

Example

Query
mutation deleteImageObjectStorage($filter: ImageObjectStorageFilter!) {
  deleteImageObjectStorage(filter: $filter) {
    imageObjectStorage {
      domain
      path
    }
    msg
    numUids
  }
}
Variables
{"filter": ImageObjectStorageFilter}
Response
{
  "data": {
    "deleteImageObjectStorage": {
      "imageObjectStorage": [ImageObjectStorage],
      "msg": "abc123",
      "numUids": 987
    }
  }
}

deleteUser

Response

Returns a DeleteUserPayload

Arguments
Name Description
filter - UserFilter!

Example

Query
mutation deleteUser($filter: UserFilter!) {
  deleteUser(filter: $filter) {
    user {
      id
      username
      profile_image_hash
      joined_date
      thirdParty {
        domain
        path
      }
    }
    msg
    numUids
  }
}
Variables
{"filter": UserFilter}
Response
{
  "data": {
    "deleteUser": {
      "user": [User],
      "msg": "abc123",
      "numUids": 987
    }
  }
}

newUser

Response

Returns an ID!

Arguments
Name Description
username - String!
password - String!
profile_image_hash - String!

Example

Query
mutation newUser(
  $username: String!,
  $password: String!,
  $profile_image_hash: String!
) {
  newUser(
    username: $username,
    password: $password,
    profile_image_hash: $profile_image_hash
  )
}
Variables
{
  "username": "xyz789",
  "password": "xyz789",
  "profile_image_hash": "abc123"
}
Response
{"data": {"newUser": {}}}

updateImageObjectStorage

Response

Returns an UpdateImageObjectStoragePayload

Arguments
Name Description
input - UpdateImageObjectStorageInput!

Example

Query
mutation updateImageObjectStorage($input: UpdateImageObjectStorageInput!) {
  updateImageObjectStorage(input: $input) {
    imageObjectStorage {
      domain
      path
    }
    numUids
  }
}
Variables
{"input": UpdateImageObjectStorageInput}
Response
{
  "data": {
    "updateImageObjectStorage": {
      "imageObjectStorage": [ImageObjectStorage],
      "numUids": 987
    }
  }
}

updateUser

Response

Returns an UpdateUserPayload

Arguments
Name Description
input - UpdateUserInput!

Example

Query
mutation updateUser($input: UpdateUserInput!) {
  updateUser(input: $input) {
    user {
      id
      username
      profile_image_hash
      joined_date
      thirdParty {
        domain
        path
      }
    }
    numUids
  }
}
Variables
{"input": UpdateUserInput}
Response
{"data": {"updateUser": {"user": [User], "numUids": 987}}}

Types

AddImageObjectStorageInput

Fields
Input Field Description
domain - String!
path - String!
Example
{}

AddImageObjectStoragePayload

Fields
Field Name Description
imageObjectStorage - [ImageObjectStorage]
Arguments
first - Int
offset - Int
numUids - Int
Example
{
  "imageObjectStorage": [ImageObjectStorage],
  "numUids": 123
}

AddUserInput

Fields
Input Field Description
username - String!
profile_image_hash - String!
joined_date - DateTime!
thirdParty - ImageObjectStorageRef!
password - String!
Example
{}

AddUserPayload

Fields
Field Name Description
user - [User]
Arguments
filter - UserFilter
order - UserOrder
first - Int
offset - Int
numUids - Int
Example
{"user": [User], "numUids": 987}

AuthRule

Fields
Input Field Description
and - [AuthRule]
or - [AuthRule]
not - AuthRule
rule - String
Example
{}

Boolean

Description

The Boolean scalar type represents true or false.

Example
{}

DateTime

Description

The DateTime scalar type represents date and time as a string in RFC3339 format. For example: "1985-04-12T23:20:50.52Z" represents 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.

Example
{}

DateTimeFilter

Fields
Input Field Description
eq - DateTime
in - [DateTime]
le - DateTime
lt - DateTime
ge - DateTime
gt - DateTime
between - DateTimeRange
Example
{}

DateTimeRange

Fields
Input Field Description
min - DateTime!
max - DateTime!
Example
{}

DeleteImageObjectStoragePayload

Fields
Field Name Description
imageObjectStorage - [ImageObjectStorage]
Arguments
first - Int
offset - Int
msg - String
numUids - Int
Example
{
  "imageObjectStorage": [ImageObjectStorage],
  "msg": "abc123",
  "numUids": 123
}

DeleteUserPayload

Fields
Field Name Description
user - [User]
Arguments
filter - UserFilter
order - UserOrder
first - Int
offset - Int
msg - String
numUids - Int
Example
{
  "user": [User],
  "msg": "abc123",
  "numUids": 123
}

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
{}

ImageObjectStorage

Fields
Field Name Description
domain - String!
path - String!
Example
{
  "domain": "abc123",
  "path": "abc123"
}

ImageObjectStorageAggregateResult

Fields
Field Name Description
count - Int
domainMin - String
domainMax - String
pathMin - String
pathMax - String
Example
{
  "count": 987,
  "domainMin": "abc123",
  "domainMax": "abc123",
  "pathMin": "abc123",
  "pathMax": "xyz789"
}

ImageObjectStorageFilter

ImageObjectStorageHasFilter

Values
Enum Value Description

domain

path

Example
{}

ImageObjectStorageOrder

Fields
Input Field Description
asc - ImageObjectStorageOrderable
desc - ImageObjectStorageOrderable
then - ImageObjectStorageOrder
Example
{}

ImageObjectStorageOrderable

Values
Enum Value Description

domain

path

Example
{}

ImageObjectStoragePatch

Fields
Input Field Description
domain - String
path - String
Example
{}

ImageObjectStorageRef

Fields
Input Field Description
domain - String
path - String
Example
{}

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
{}

String

Description

The Stringscalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
{}

StringFullTextFilter

Fields
Input Field Description
alloftext - String
anyoftext - String
Example
{}

StringHashFilter

Fields
Input Field Description
eq - String
in - [String]
Example
{}

UpdateImageObjectStorageInput

Fields
Input Field Description
filter - ImageObjectStorageFilter!
set - ImageObjectStoragePatch
remove - ImageObjectStoragePatch
Example
{}

UpdateImageObjectStoragePayload

Fields
Field Name Description
imageObjectStorage - [ImageObjectStorage]
Arguments
first - Int
offset - Int
numUids - Int
Example
{
  "imageObjectStorage": [ImageObjectStorage],
  "numUids": 123
}

UpdateUserInput

Fields
Input Field Description
filter - UserFilter!
set - UserPatch
remove - UserPatch
Example
{}

UpdateUserPayload

Fields
Field Name Description
user - [User]
Arguments
filter - UserFilter
order - UserOrder
first - Int
offset - Int
numUids - Int
Example
{"user": [User], "numUids": 123}

User

Fields
Field Name Description
id - ID!
username - String!
profile_image_hash - String!
joined_date - DateTime!
thirdParty - ImageObjectStorage!
Arguments
Example
{
  "id": 4,
  "username": "abc123",
  "profile_image_hash": "xyz789",
  "joined_date": "2007-12-03T10:15:30Z",
  "thirdParty": ImageObjectStorage
}

UserAggregateResult

Fields
Field Name Description
count - Int
usernameMin - String
usernameMax - String
profile_image_hashMin - String
profile_image_hashMax - String
joined_dateMin - DateTime
joined_dateMax - DateTime
Example
{
  "count": 123,
  "usernameMin": "xyz789",
  "usernameMax": "abc123",
  "profile_image_hashMin": "abc123",
  "profile_image_hashMax": "xyz789",
  "joined_dateMin": "2007-12-03T10:15:30Z",
  "joined_dateMax": "2007-12-03T10:15:30Z"
}

UserFilter

Fields
Input Field Description
id - [ID!]
username - StringHashFilter
profile_image_hash - StringHashFilter
joined_date - DateTimeFilter
has - [UserHasFilter]
and - [UserFilter]
or - [UserFilter]
not - UserFilter
Example
{}

UserHasFilter

Values
Enum Value Description

username

profile_image_hash

joined_date

thirdParty

Example
{}

UserOrder

Fields
Input Field Description
asc - UserOrderable
desc - UserOrderable
then - UserOrder
Example
{}

UserOrderable

Values
Enum Value Description

username

profile_image_hash

joined_date

Example
{}

UserPatch

Fields
Input Field Description
joined_date - DateTime
thirdParty - ImageObjectStorageRef
password - String
Example
{}

Subscriptions

aggregateUser

Response

Returns a UserAggregateResult

Arguments
Name Description
filter - UserFilter

Example

Query
subscription aggregateUser($filter: UserFilter) {
  aggregateUser(filter: $filter) {
    count
    usernameMin
    usernameMax
    profile_image_hashMin
    profile_image_hashMax
    joined_dateMin
    joined_dateMax
  }
}
Variables
{"filter": UserFilter}
Response
{
  "data": {
    "aggregateUser": {
      "count": 987,
      "usernameMin": "abc123",
      "usernameMax": "abc123",
      "profile_image_hashMin": "abc123",
      "profile_image_hashMax": "xyz789",
      "joined_dateMin": "2007-12-03T10:15:30Z",
      "joined_dateMax": "2007-12-03T10:15:30Z"
    }
  }
}

getUser

Response

Returns a User

Arguments
Name Description
id - ID
username - String
profile_image_hash - String

Example

Query
subscription getUser(
  $id: ID,
  $username: String,
  $profile_image_hash: String
) {
  getUser(
    id: $id,
    username: $username,
    profile_image_hash: $profile_image_hash
  ) {
    id
    username
    profile_image_hash
    joined_date
    thirdParty {
      domain
      path
    }
  }
}
Variables
{
  "id": 4,
  "username": "abc123",
  "profile_image_hash": "xyz789"
}
Response
{
  "data": {
    "getUser": {
      "id": "4",
      "username": "xyz789",
      "profile_image_hash": "xyz789",
      "joined_date": "2007-12-03T10:15:30Z",
      "thirdParty": ImageObjectStorage
    }
  }
}

queryUser

Response

Returns [User]

Arguments
Name Description
filter - UserFilter
order - UserOrder
first - Int
offset - Int

Example

Query
subscription queryUser(
  $filter: UserFilter,
  $order: UserOrder,
  $first: Int,
  $offset: Int
) {
  queryUser(
    filter: $filter,
    order: $order,
    first: $first,
    offset: $offset
  ) {
    id
    username
    profile_image_hash
    joined_date
    thirdParty {
      domain
      path
    }
  }
}
Variables
{
  "filter": UserFilter,
  "order": UserOrder,
  "first": 123,
  "offset": 123
}
Response
{
  "data": {
    "queryUser": [
      {
        "id": 4,
        "username": "abc123",
        "profile_image_hash": "abc123",
        "joined_date": "2007-12-03T10:15:30Z",
        "thirdParty": ImageObjectStorage
      }
    ]
  }
}