~bigbes/sr-ht-dolt

ref: bd2d8a3680e62716440ea0165d2271d79f9d526e sr-ht-dolt/graph/gqlgen.yml -rw-r--r-- 2.1 KiB
bd2d8a36 — Eugene Blikh doltsrht: serve /query and the api-meta.json beside it 3 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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