2025-10-27 09:23:56 +00:00
|
|
|
extend schema
|
|
|
|
|
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key", "@tag", "@shareable"])
|
2025-11-21 18:08:56 +00:00
|
|
|
@link(url: "https://specs.graphql-hive.com/hive/v1.0", import: ["@meta"])
|
|
|
|
|
@meta(name: "owner", content: "users-team")
|
|
|
|
|
@meta(name: "contact", content: "#users-channel")
|
|
|
|
|
|
2025-10-27 09:23:56 +00:00
|
|
|
directive @tag(name: String!) repeatable on FIELD_DEFINITION | OBJECT
|
|
|
|
|
|
2025-11-21 18:08:56 +00:00
|
|
|
directive @meta(
|
|
|
|
|
name: String!
|
|
|
|
|
content: String!
|
|
|
|
|
) repeatable on SCHEMA | OBJECT | INTERFACE | FIELD_DEFINITION
|
|
|
|
|
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
## User Account
|
|
|
|
|
|
|
|
|
|
Represents a **registered user** in the system. User data is subject to *strict privacy controls*.
|
|
|
|
|
|
|
|
|
|
### Key Features
|
|
|
|
|
- Unique identification via `id` and `username`
|
|
|
|
|
- Personal information (tagged as PII)
|
|
|
|
|
- Account creation tracking
|
|
|
|
|
|
|
|
|
|
> **Important**: Email and name fields contain Personally Identifiable Information (PII) and must be handled according to data privacy regulations.
|
|
|
|
|
|
|
|
|
|
**Authentication**: Users authenticate via email or username
|
|
|
|
|
**Federation**: Extended by other subgraphs for additional user data
|
|
|
|
|
"""
|
2025-11-21 18:08:56 +00:00
|
|
|
type User
|
|
|
|
|
@key(fields: "id")
|
|
|
|
|
@key(fields: "email")
|
|
|
|
|
@meta(name: "domain", content: "users")
|
|
|
|
|
@meta(name: "priority", content: "tier1") {
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
Unique identifier for the user
|
|
|
|
|
"""
|
2025-10-27 09:23:56 +00:00
|
|
|
id: ID!
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
User's email address (tagged as PII for data privacy compliance)
|
|
|
|
|
"""
|
2025-11-21 18:08:56 +00:00
|
|
|
email: String! @tag(name: "pii") @meta(name: "sensitivity", content: "pii")
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
User's full name
|
|
|
|
|
"""
|
2025-11-21 18:08:56 +00:00
|
|
|
name: String @meta(name: "sensitivity", content: "pii")
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
User's display alias or username
|
|
|
|
|
"""
|
2025-10-27 09:23:56 +00:00
|
|
|
alias: String
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
Total number of products created by this user
|
|
|
|
|
"""
|
2025-10-27 09:23:56 +00:00
|
|
|
totalProductsCreated: Int @shareable
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
Timestamp when the user account was created
|
|
|
|
|
"""
|
2025-10-27 09:23:56 +00:00
|
|
|
createdAt: DateTime
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
ISO-8601 formatted date and time string
|
|
|
|
|
"""
|
2025-10-27 09:23:56 +00:00
|
|
|
scalar DateTime
|
|
|
|
|
|
2025-11-19 04:05:03 +00:00
|
|
|
"""
|
|
|
|
|
Input for creating a new user account
|
|
|
|
|
"""
|
|
|
|
|
input CreateUserInput {
|
|
|
|
|
"""
|
|
|
|
|
User's email address (required)
|
|
|
|
|
"""
|
|
|
|
|
email: String!
|
|
|
|
|
"""
|
|
|
|
|
User's full name (required)
|
|
|
|
|
"""
|
|
|
|
|
name: String!
|
|
|
|
|
"""
|
|
|
|
|
Optional display alias or username
|
|
|
|
|
"""
|
|
|
|
|
alias: String
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
Input for updating an existing user account
|
|
|
|
|
"""
|
|
|
|
|
input UpdateUserInput {
|
|
|
|
|
"""
|
|
|
|
|
Updated full name
|
|
|
|
|
"""
|
|
|
|
|
name: String
|
|
|
|
|
"""
|
|
|
|
|
Updated display alias or username
|
|
|
|
|
"""
|
|
|
|
|
alias: String
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-27 09:23:56 +00:00
|
|
|
extend type Query {
|
|
|
|
|
me: User
|
|
|
|
|
user(id: ID!): User
|
|
|
|
|
users: [User]
|
|
|
|
|
}
|
2025-11-19 04:05:03 +00:00
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
|
createUser(input: CreateUserInput!): User!
|
|
|
|
|
updateUser(id: ID!, input: UpdateUserInput!): User
|
|
|
|
|
}
|