GraphQL API Calling Obligations (Content Mutations)¶
This document defines client obligations when calling the marketing GraphQL BFF.
Scope¶
- Content domains:
- Article
- ArticleCollection
- Product
- ProductCollection
- Operations:
- create/update/delete
- relationship updates (for example collection membership)
Caller Obligations¶
- Use BFF as the only mutation path
-
Do not mutate Odoo content directly from client applications.
-
Provide domain payload only
- Send only business/content fields required by the mutation contract.
-
Do not send internal audit identity fields.
-
Use stable identifiers consistently
- Prefer canonical keys (
articleKey,productKey,collectionKey) from BFF responses. -
Do not infer IDs across types.
-
Preserve idempotency and retry safety
- Use deterministic keys/slugs where contract allows.
-
Handle network retries without creating duplicate logical records.
-
Enforce schema correctness
- Match exact GraphQL scalar types expected by server.
- Example: if a mutation expects
[Int!]!, do not send[String!]!.
Forbidden Input Fields¶
Clients must not send these as authoritative values in mutation payloads:
createdByupdatedBycreatedAtupdatedAt
These are server-managed by BFF and mapped into Odoo audit records.
Response Consumption Requirements¶
- Treat server-returned audit fields as authoritative.
- For post-mutation state checks, compare returned entity keys and
updatedAt/updatedByvalues.
Error Handling Requirements¶
- On validation/type errors, do not silently coerce and retry with guessed schema.
- Log the exact GraphQL error and correct the request contract first.
Security and Accountability¶
- Caller authentication must be present for all mutation operations.
- BFF resolves actor from auth context and stamps audit fields server-side.
- Real credential identity is operational/internal and not a public content attribute.