octoposprime / op-be-graphql

OctopOS Prime Backend Api Gateway
http://www.octoposprime.com
MIT License
13 stars 1 forks source link

Unexpected Results in Filtering Admin Users Query #57

Closed Maraza25 closed 4 months ago

Maraza25 commented 4 months ago

When the GraphQL query is run, although there are 4 registered users with the role or user type 'ADMIN' in the system, only 1 user is returned. This suggests that there may be a problem with the query or SearchText filter.

Query Details:

query users {
  users(filter: {
    SearchText: "ADMIN"
  }) {
    Total
    Users {
      Id
      UserName
      Email
      Role
      UserType
      UserStatus
      UserBase {
        Tags
        FirstName
        LastName
      }
      UpdatedAt
    }
  }
}

Expected Result: As a result of the query, all users with the role or user type 'ADMIN' (4 users in this example) are expected to be listed.

Result Received:

{
  "data": {
    "users": {
      "total": 1,
      "Users": [
        {
          "Id": "9cee66a6-8788-47ba-b53e-c0fb3ab29722",
          "UserName": "op_admin",
          "Email": "op_admin@op.com",
          "Role": "ADMIN",
          "UserType": "ADMIN",
          "UserStatus": "ACTIVE",
          "UserBase": {
            "Tags": [],
            "FirstName": "",
            "LastName": ""
          },
          "UpdatedAt": "2024-04-03T15:07:51.042776Z"
        }
      ]
    }
  }
}

Question: Is the query working correctly or is there an error in the SearchText filter? Is the 'SearchText' filter searching for usernames, email addresses or some other field?

In light of this information, it is recommended that the technical team investigate the problem and update the query or filters if necessary.

husamettinarabaci commented 4 months ago

The search system searches only text areas in any data, so role or user type is not used to search. They are used only in filter systems.