A component (models.Component, component.graphql) is a named HTML box. "+ New box" now lists components and places a copy, as it did with the hard-coded starters; the canvas's new Components button (ComponentPanel) can also place one linked. A linked box has Box.componentId, its row's html is nil, and the resolvers fill in the component's html before answering (fillLinked), so saving the html in the box editor saves the component and every linked box on every page changes. Only the html is shared: title, geometry, frame and visibility stay each box's own. The box editor gains "Save as component" (makes one from an html box and links it) and, on a linked box, a banner with Detach (gives the box its own copy). updateBox refuses html on a linked box. Deleting a component detaches its boxes first, so no page changes. Layouts store the link and the html; loading relinks only if the component still exists. The built-in starters in templates.js are no longer listed directly: "Import built-ins" in the panel creates them as components (skipping names already taken), so they can be edited and deleted like the rest. The html helpers there are unchanged. Everything is @admin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
119 lines
2.7 KiB
YAML
119 lines
2.7 KiB
YAML
schema:
|
|
- graph/schema/*.graphql
|
|
|
|
exec:
|
|
filename: graph/generated.go
|
|
package: graph
|
|
|
|
model:
|
|
filename: graph/model/models_gen.go
|
|
package: model
|
|
|
|
resolver:
|
|
layout: follow-schema
|
|
dir: graph
|
|
package: graph
|
|
filename_template: "{name}.resolvers.go"
|
|
|
|
models:
|
|
# Two bindings, tried in order. IntID comes first, so it is what gqlgen
|
|
# picks where it has a free choice — resolver arguments stay `id int`.
|
|
# UintID is there so a model's `ID uint` field binds to `id: ID!` directly,
|
|
# with no hand-written resolver converting it. Both write an id as a quoted
|
|
# decimal string ("12") and read a string or a number, so which one a field
|
|
# uses is invisible on the wire.
|
|
ID:
|
|
model:
|
|
- github.com/99designs/gqlgen/graphql.IntID
|
|
- github.com/99designs/gqlgen/graphql.UintID
|
|
User:
|
|
model:
|
|
- adam-french.co.uk/backend/models.User
|
|
fields:
|
|
password:
|
|
resolver: false
|
|
deletedAt:
|
|
resolver: false
|
|
# Not a database model: the fixed registry in services/permissions.go.
|
|
PermissionType:
|
|
model:
|
|
- adam-french.co.uk/backend/services.PermissionType
|
|
Post:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Post
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Activity:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Activity
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Favorite:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Favorite
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Rowing:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Rowing
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Message:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Message
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Bookmark:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Bookmark
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Place:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Place
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Box:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Box
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Page:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Page
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Background:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Background
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
Layout:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Layout
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
boxCount:
|
|
resolver: true
|
|
hasBackground:
|
|
resolver: true
|
|
Component:
|
|
model:
|
|
- adam-french.co.uk/backend/models.Component
|
|
fields:
|
|
deletedAt:
|
|
resolver: false
|
|
uses:
|
|
resolver: true
|