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

Example — identity/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 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

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) {
    items {
      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: CreateIdentityUserDto!) {
  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: CreateIdentityUserItemsDto!) {
  createIdentityUserBulk(data: $data) {
    items {
      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: UpdateIdentityUserDto!, $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: UpdateIdentityUserDto!) {
  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: {} }) { items { 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 ​

The /auth controller does not follow the CRUD pattern, but it does have a resolver: four mutations — token(data: AuthAuthenticationDto), verify, logout and can(data: AuthAuthorizationDto) — plus the CRUD resolvers of auth/apts and auth/grants.

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
SMSsTouchSmscreateTouchSms
Push HistoriesTouchPusHistoryfindTouchPusHistory

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
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 }
IdentityUserDataSerializer{ data: IdentityUserSerializer }
IdentityUserItemsSerializer{ items: [IdentityUserSerializer], meta } — meta optional and unset by the base handlers; no count

All entity types include the common platform fields.