# {{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