Backend Version Update 1.2.0 - peer-network/peer_backend GitHub Wiki

GraphQL Schema Update Log

1.1.0 -> 1.2.0

Guest Schema Version 1.1.0 → Version 1.2.0

Changes in the Schema

Modified Return Type for RegisterResponse

Type Modified: type RegisterResponse

Change: Field status changed from non-nullable String (String!) to nullable String (String).

Impact:

Clients expecting status to always be a non-nullable String must handle possible null values.

Before:

type RegisterResponse {
  status: String!
  ResponseCode: String
  userid: ID
}

After:

type RegisterResponse {
  status: String
  ResponseCode: String
  userid: ID
}

Action Required for Clients

Check client handling of status field. Add null checks where needed.

User Schema Version 1.1.0 → Version 1.2.0

Changes in the Schema

Modified Profile Type Fields

Type Modified: type Profile

Change: Field amountfriends changed from non-nullable Int (Int!) to nullable Int (Int).
New field amountblocked: Int added.

Impact:

Clients must handle possible null values in amountfriends.
Clients can now access amountblocked.

Before:

type Profile {
  amountfriends: Int!
  ...
}

After:

type Profile {
  amountfriends: Int
  amountblocked: Int
  ...
}

Structural Update to BlockedUser and Blocked Types

Types Modified: BlockedUser, Blocked

Changes:

BlockedUser now uses fields: userid, img, username, slug instead of blockerid, blockedid, createdat.
Blocked type fields renamed to iBlocked and blockedBy.

Impact:

Clients must update data mapping accordingly.

Before:

type BlockedUser {
  blockerid: String
  blockedid: String
  createdat: Date
}

type Blocked {
  blockerid: [BlockedUser!]
  blockedid: [BlockedUser!]
}

After:

type BlockedUser {
  userid: String
  img: String
  username: String
  slug: Int
}

type Blocked {
  iBlocked: [BlockedUser!]
  blockedBy: [BlockedUser!]
}

Added Field counter to UserBlocked Type

Type Modified: UserBlocked

Change: New non-nullable field counter: Int! added.

Before:

type UserBlocked {
  status: String
  ResponseCode: String
  affectedRows: Blocked
}

After:

type UserBlocked {
  status: String
  counter: Int!
  ResponseCode: String
  affectedRows: Blocked
}

Impact:

Clients can now access the total count of blocked users.

Added Field amountreplies to Comment Type

Type Modified: Comment

Change: New field amountreplies: Int! added.

Before:

type Comment {
  content: String!
  createdat: Date!
  amountlikes: Int!
  isliked: Boolean!
  user: ProfilUser!
}

After:

type Comment {
  content: String!
  createdat: Date!
  amountlikes: Int!
  amountreplies: Int!
  isliked: Boolean!
  user: ProfilUser!
}

Impact:

Clients can now retrieve the amount of replies for a comment.

Modified Field image in CreateChatInput

Input Modified: CreateChatInput

Change: image field changed from non-nullable String (String!) to nullable String (String).

Before:

input CreateChatInput {
  name: String!
  image: String!
  recipients: [String!]!
}

After:

input CreateChatInput {
  name: String!
  image: String
  recipients: [String!]!
}

Impact:

Clients may now omit the image field when creating a chat.