Skip to content

GraphQL Reference

The gateway exposes a full GraphQL API at http://localhost:3010/graphql powered by Apollo Server. Every collection that has a REST controller also has a GraphQL resolver with identical business logic, guards, and caching behavior.

Playground: http://localhost:3010/graphql


Naming Convention

GraphQL operation names follow a predictable pattern:

{verb}{ServiceName}{CollectionName}[ById|Bulk]
VerbREST equivalentType
countGET /countQuery
createPOST /Mutation
createBulkPOST /bulkMutation
findGET /Query
findByIdGET /:idQuery
updateByIdPATCH /:idMutation
updateBulkPATCH /bulkMutation
deleteByIdDELETE /:idMutation
restoreByIdPUT /:id/restoreMutation
destroyByIdDELETE /:id/destroyMutation

Exampleidentity/users collection:

OperationGraphQL name
CountcountIdentityUser
Create onecreateIdentityUser
Create manycreateIdentityUserBulk
Find listfindIdentityUser
Find by IDfindIdentityUserById
Update by IDupdateIdentityUserById
Update bulkupdateIdentityUserBulk
Soft deletedeleteIdentityUserById
RestorerestoreIdentityUserById
Hard deletedestroyIdentityUserById

Authentication

Pass the JWT in the Authorization HTTP header exactly as with REST:

http
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...

In the Apollo Playground, use the Headers tab at the bottom.


Query Examples — Identity Users

Count

graphql
query CountUsers($filter: QueryFilterDto!) {
  countIdentityUser(filter: $filter) {
    total
  }
}

Variables:

json
{ "filter": { "query": {} } }

Find List

graphql
query FindUsers($filter: FilterDto!) {
  findIdentityUser(filter: $filter) {
    count
    data {
      id
      username
      email
      name
      created_at
    }
  }
}

Variables with pagination:

json
{
  "filter": {
    "query": {},
    "pagination": {
      "limit": 10,
      "skip": 0,
      "sort": { "created_at": -1 }
    }
  }
}

Find by ID

graphql
query FindUserById($id: String!, $ref: String) {
  findIdentityUserById(id: $id, ref: $ref) {
    data {
      id
      username
      email
      name
      created_at
      updated_at
    }
  }
}

Variables:

json
{ "id": "64a1b2c3d4e5f6a7b8c9d0e1" }

Create One

graphql
mutation CreateUser($data: CreateUserDto!) {
  createIdentityUser(data: $data) {
    data {
      id
      username
      email
      created_at
    }
  }
}

Variables:

json
{
  "data": {
    "username": "jdoe",
    "email": "jdoe@example.com",
    "password": "Str0ng!Pass",
    "name": "John Doe"
  }
}

Create Bulk

graphql
mutation CreateUsersBulk($data: CreateUserItemsDto!) {
  createIdentityUserBulk(data: $data) {
    count
    data {
      id
      username
    }
  }
}

Variables:

json
{
  "data": {
    "items": [
      { "username": "alice", "email": "alice@example.com" },
      { "username": "bob",   "email": "bob@example.com" }
    ]
  }
}

Update by ID

graphql
mutation UpdateUser($id: String!, $data: UpdateUserDto!, $ref: String) {
  updateIdentityUserById(id: $id, data: $data, ref: $ref) {
    data {
      id
      username
      name
      updated_at
    }
  }
}

Variables:

json
{
  "id": "64a1b2c3d4e5f6a7b8c9d0e1",
  "data": { "name": "Jonathan Doe" }
}

Update Bulk

graphql
mutation UpdateUsersBulk($filter: QueryFilterDto!, $data: UpdateUserDto!) {
  updateIdentityUserBulk(filter: $filter, data: $data) {
    total
  }
}

Variables:

json
{
  "filter": { "query": { "status": "inactive" } },
  "data": { "archived": true }
}

Soft Delete

graphql
mutation DeleteUser($id: String!, $ref: String) {
  deleteIdentityUserById(id: $id, ref: $ref) {
    data {
      id
      deleted_at
    }
  }
}

Restore

graphql
mutation RestoreUser($id: String!, $ref: String) {
  restoreIdentityUserById(id: $id, ref: $ref) {
    data {
      id
      deleted_at
    }
  }
}

Hard Delete (Destroy)

graphql
mutation DestroyUser($id: String!, $ref: String) {
  destroyIdentityUserById(id: $id, ref: $ref) {
    data {
      id
    }
  }
}

Requires manage:identity:users scope.


Using curl with GraphQL

bash
curl -X POST http://localhost:3010/graphql \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { findIdentityUser(filter: { query: {} }) { count data { id username email } } }"
  }'

With variables:

bash
curl -X POST http://localhost:3010/graphql \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query FindById($id: String!) { findIdentityUserById(id: $id) { data { id username email } } }",
    "variables": { "id": "64a1b2c3d4e5f6a7b8c9d0e1" }
  }'

Operation Name Reference

Auth Service

Note: The /auth controller does not follow the standard CRUD pattern and has no resolver.

Identity Service

CollectionPrefixExample operation
UsersIdentityUserfindIdentityUser
ProfilesIdentityProfilecreateIdentityProfile
SessionsIdentitySessiondeleteIdentitySessionById

Financial Service

CollectionPrefixExample operation
AccountsFinancialAccountfindFinancialAccount
WalletsFinancialWalletupdateFinancialWalletById
InvoicesFinancialInvoicecreateFinancialInvoice
TransactionsFinancialTransactionfindFinancialTransaction
CurrenciesFinancialCurrencycreateFinancialCurrency

Career Service

CollectionPrefixExample operation
BusinessesCareerBusinessfindCareerBusiness
BranchesCareerBranchcreateCareerBranch
EmployeesCareerEmployeeupdateCareerEmployeeById
ProductsCareerProductdeleteCareerProductById
ServicesCareerServicefindCareerService
StocksCareerStockcreateCareerStock
StoresCareerStorefindCareerStore
CustomersCareerCustomercreateCareerCustomer

Domain Service

CollectionPrefixExample operation
AppsDomainAppfindDomainApp
ClientsDomainClientcreateDomainClient

Essential Service

CollectionPrefixExample operation
SagasEssentialSagafindEssentialSaga
Saga StagesEssentialSagaStagefindEssentialSagaStageById

Context Service

CollectionPrefixExample operation
ConfigsContextConfigcreateContextConfig
SettingsContextSettingupdateContextSettingById

General Service

CollectionPrefixExample operation
ActivitiesGeneralActivityfindGeneralActivity
ArtifactsGeneralArtifactcreateGeneralArtifact
CommentsGeneralCommentfindGeneralComment
EventsGeneralEventcreateGeneralEvent
WorkflowsGeneralWorkflowfindGeneralWorkflow

Special Service

CollectionPrefixExample operation
FilesSpecialFilefindSpecialFile
StatsSpecialStatfindSpecialStat

Touch Service

CollectionPrefixExample operation
EmailsTouchEmailcreateTouchEmail
NoticesTouchNoticefindTouchNotice
PushesTouchPushcreateTouchPush
SMSTouchSmscreateTouchSms
HistoriesTouchHistoryfindTouchHistory

Content Service

CollectionPrefixExample operation
NotesContentNotecreateContentNote
PostsContentPostfindContentPost
TicketsContentTicketcreateContentTicket

Logistic Service

CollectionPrefixExample operation
LocationsLogisticLocationfindLogisticLocation
DriversLogisticDrivercreateLogisticDriver
VehiclesLogisticVehiclefindLogisticVehicle
TravelsLogisticTravelcreateLogisticTravel
CargoesLogisticCargofindLogisticCargo

Conjoint Service

CollectionPrefixExample operation
AccountsConjointAccountfindConjointAccount
ChannelsConjointChannelcreateConjointChannel
ContactsConjointContactfindConjointContact
MembersConjointMembercreateConjointMember
MessagesConjointMessagefindConjointMessage

Thing Service

CollectionPrefixExample operation
DevicesThingDevicecreateThingDevice
SensorsThingSensorfindThingSensor
MetricsThingMetriccreateThingMetric

Filter Input Types

GraphQL reuses the same filter system as REST. The input types map to:

Input TypeFieldsUsage
QueryFilterDtoqueryFor count and updateBulk
FilterDtoquery, populate, projection, paginationFor find and updateBulk
FilterOneDtoquery, populate, projectionFor single-entity operations

See Filtering & Pagination for the complete field reference.


Response Types

GraphQL returns typed serializers. The shape mirrors the REST response envelope:

Return typeShape
TotalSerializer{ total: Int }
UserDataSerializer{ data: User }
UserItemsSerializer{ data: [User], count: Int }

All entity types include the common platform fields.