Files
semprini-data-product-templ…/canonical_data_product/graphql/schema.graphql
T
paulandClaude Opus 5 62a3714562 Add the canonical data product template
Moves the data product template from semprini-blog-dataproducts, as adapted to
the semprini-data domain platform, into canonical_data_product/. Its worked
example passed 9 of 9 checks on the domain platform on 2026-09-17.

Adds agent-canonical-product, the blog's agent-product adapted to generate a
product into a domain repository from a declaration in the domain's model
repository, and README/CLAUDE.md describing the template catalogue, the
product contract with the domain platform, and team ownership. Source-aligned
and experience templates are planned.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 22:55:11 +12:00

36 lines
1.7 KiB
GraphQL

# {{product.name}}: GraphQL surface reflected by pg_graphql from the ODS tables.
#
# This file documents the contract consumers can rely on. It is not loaded anywhere; the live
# schema is reflected from the tables and available by introspection:
# curl http://localhost:{{platform.graphql_port}}/rpc/{{product.schema}}_graphql -H 'Content-Type: application/json' \
# --data '{"query":"{ __type(name: \"{{Entity}}\") { fields { name } } }"}'
#
# Naming (inflect_names: true): table {{table}} -> type {{Entity}}; column {{column}} -> {{camelColumn}}.
# Scalars: uuid -> UUID, text -> String, boolean -> Boolean, bigint -> BigInt, numeric -> BigFloat,
# date -> Date, timestamptz -> Datetime, text[] -> [String].
# >>> repeat per entity table
type {{Entity}} implements Node {
nodeId: ID!
{{entity}}Id: UUID!
{{camelColumn}}: {{GraphQLType}} # {{attribute.name}}
createdAt: Datetime!
updatedAt: Datetime!
{{parent}}: {{Parent}} # from {{parent_table}}_id (one-to-many, this side)
{{child}}Collection(first: Int, after: Cursor, filter: {{Child}}Filter, orderBy: [{{Child}}OrderBy!]): {{Child}}Connection
}
extend type Query {
{{entity}}Collection(
first: Int, last: Int, before: Cursor, after: Cursor,
filter: {{Entity}}Filter, orderBy: [{{Entity}}OrderBy!]
): {{Entity}}Connection
}
extend type Mutation {
insertInto{{Entity}}Collection(objects: [{{Entity}}InsertInput!]!): {{Entity}}InsertResponse
update{{Entity}}Collection(set: {{Entity}}UpdateInput!, filter: {{Entity}}Filter, atMost: Int! = 1): {{Entity}}UpdateResponse
deleteFrom{{Entity}}Collection(filter: {{Entity}}Filter, atMost: Int! = 1): {{Entity}}DeleteResponse
}
# <<< end repeat