# gqlgen configuration. Run `go generate ./graph` from the repository root, or # `gqlgen` from this directory; every path below is relative to this file. # # The layout is spec.sr.ht's, which is git.sr.ht's api/: the schema beside the # resolvers, the executable schema in its own package so nothing but the server # touches it, and the models autobound by name. schema: - schema.graphqls exec: filename: api/generated.go package: api model: filename: model/models_gen.go package: model resolver: layout: follow-schema dir: . package: graph # Federating into api.sr.ht is a config line on the gateway — `api-origin=` # pointing at our own /query — and not a build-time decision here. Nothing in # this schema depends on the gateway existing. autobind: - "sourcecraft.dev/bigbes/sr-ht-dolt/graph/model" models: # Everything a database's own store or a second query answers is a field # resolver, never a struct field: a listing must not open one bare store per # row to answer a query that asked for names. model.Database is hand-written # for the same reason — see the comment there. Database: fields: defaultBranch: {resolver: true} branches: {resolver: true} log: {resolver: true} tables: {resolver: true} acl: {resolver: true} # core-go's cursor, so pagination here is opaque and encrypted exactly as it # is on every other service of the instance rather than being a page number # this schema would then have to keep honest. Cursor: model: - sourcecraft.dev/bigbes/sr-ht-core/model.Cursor # And core-go's filter beside it, so "count" means here what it means on # every other service of the instance. Filter: model: - sourcecraft.dev/bigbes/sr-ht-core/model.Filter # Ids are the repository table's serial; Int is 32-bit in GraphQL and the # column is a 32-bit serial, so the Go type is int and not int64. Int: model: - github.com/99designs/gqlgen/graphql.Int - github.com/99designs/gqlgen/graphql.Int64 - github.com/99designs/gqlgen/graphql.Int32 omit_getters: true