feat: added graphql queries
This commit is contained in:
@@ -37,6 +37,11 @@ tasks:
|
||||
cmds:
|
||||
- "{{ .GO_CMD }} build {{ .PROD_FLAGS }} -o dist/server cmd/main.go"
|
||||
|
||||
build-queries:
|
||||
desc: Builds GraphQL queries
|
||||
cmds:
|
||||
- "{{ .GO_CMD }} run github.com/Khan/genqlient"
|
||||
|
||||
build-css:
|
||||
desc: Build CSS once
|
||||
sources:
|
||||
|
||||
12
genqlient.yaml
Normal file
12
genqlient.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
# Default genqlient config; for full documentation see:
|
||||
# https://github.com/Khan/genqlient/blob/main/docs/genqlient.yaml
|
||||
schema: ./internal/strapi/schema.graphql
|
||||
operations:
|
||||
- ./internal/strapi/queries/*
|
||||
generated: ./internal/repositories/strapi.go
|
||||
casing:
|
||||
default: auto_camel_case
|
||||
package: repositories
|
||||
bindings:
|
||||
DateTime:
|
||||
type: time.Time
|
||||
13
go.mod
13
go.mod
@@ -3,21 +3,30 @@ module blog
|
||||
go 1.25.5
|
||||
|
||||
require (
|
||||
github.com/Khan/genqlient v0.8.1
|
||||
github.com/Oudwins/tailwind-merge-go v0.2.1
|
||||
github.com/a-h/templ v0.3.977
|
||||
github.com/charmbracelet/log v0.4.2
|
||||
github.com/redis/go-redis/v9 v9.17.3
|
||||
gorm.io/driver/postgres v1.6.0
|
||||
gorm.io/gorm v1.31.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/agnivade/levenshtein v1.1.1 // indirect
|
||||
github.com/alexflint/go-arg v1.5.1 // indirect
|
||||
github.com/alexflint/go-scalar v1.2.0 // indirect
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
|
||||
github.com/charmbracelet/lipgloss v1.1.0 // indirect
|
||||
github.com/charmbracelet/x/ansi v0.8.0 // indirect
|
||||
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
|
||||
github.com/charmbracelet/x/term v0.2.1 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/go-logfmt/logfmt v0.6.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/pgx/v5 v5.6.0 // indirect
|
||||
@@ -29,10 +38,14 @@ require (
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/muesli/termenv v0.16.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/vektah/gqlparser/v2 v2.5.19 // indirect
|
||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||
golang.org/x/crypto v0.31.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||
golang.org/x/mod v0.26.0 // indirect
|
||||
golang.org/x/sync v0.16.0 // indirect
|
||||
golang.org/x/sys v0.34.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/tools v0.35.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
||||
37
go.sum
37
go.sum
@@ -1,9 +1,28 @@
|
||||
github.com/Khan/genqlient v0.8.1 h1:wtOCc8N9rNynRLXN3k3CnfzheCUNKBcvXmVv5zt6WCs=
|
||||
github.com/Khan/genqlient v0.8.1/go.mod h1:R2G6DzjBvCbhjsEajfRjbWdVglSH/73kSivC9TLWVjU=
|
||||
github.com/Oudwins/tailwind-merge-go v0.2.1 h1:jxRaEqGtwwwF48UuFIQ8g8XT7YSualNuGzCvQ89nPFE=
|
||||
github.com/Oudwins/tailwind-merge-go v0.2.1/go.mod h1:kkZodgOPvZQ8f7SIrlWkG/w1g9JTbtnptnePIh3V72U=
|
||||
github.com/a-h/templ v0.3.977 h1:kiKAPXTZE2Iaf8JbtM21r54A8bCNsncrfnokZZSrSDg=
|
||||
github.com/a-h/templ v0.3.977/go.mod h1:oCZcnKRf5jjsGpf2yELzQfodLphd2mwecwG4Crk5HBo=
|
||||
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
|
||||
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
|
||||
github.com/alexflint/go-arg v1.5.1 h1:nBuWUCpuRy0snAG+uIJ6N0UvYxpxA0/ghA/AaHxlT8Y=
|
||||
github.com/alexflint/go-arg v1.5.1/go.mod h1:A7vTJzvjoaSTypg4biM5uYNTkJ27SkNTArtYXnlqVO8=
|
||||
github.com/alexflint/go-scalar v1.2.0 h1:WR7JPKkeNpnYIOfHRa7ivM21aWAdHD0gEWHCx+WQBRw=
|
||||
github.com/alexflint/go-scalar v1.2.0/go.mod h1:LoFvNMqS1CPrMVltza4LvnGKhaSpc3oyLEBUZVhhS2o=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
|
||||
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
|
||||
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
|
||||
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
|
||||
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
|
||||
@@ -19,10 +38,15 @@ github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNE
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
|
||||
github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
|
||||
github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||
@@ -45,20 +69,29 @@ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc
|
||||
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/redis/go-redis/v9 v9.17.3 h1:fN29NdNrE17KttK5Ndf20buqfDZwGNgoUr9qjl1DQx4=
|
||||
github.com/redis/go-redis/v9 v9.17.3/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
|
||||
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/vektah/gqlparser/v2 v2.5.19 h1:bhCPCX1D4WWzCDvkPl4+TP1N8/kLrWnp43egplt7iSg=
|
||||
github.com/vektah/gqlparser/v2 v2.5.19/go.mod h1:y7kvl5bBlDeuWIvLtA9849ncyvx6/lj06RsMrEjVy3U=
|
||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
|
||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
|
||||
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
|
||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
|
||||
golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg=
|
||||
golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ=
|
||||
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@@ -66,7 +99,11 @@ golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0=
|
||||
golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
701
internal/repositories/strapi.go
Normal file
701
internal/repositories/strapi.go
Normal file
@@ -0,0 +1,701 @@
|
||||
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
|
||||
|
||||
package repositories
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/Khan/genqlient/graphql"
|
||||
)
|
||||
|
||||
// Fragment for authors
|
||||
type Author struct {
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Bio string `json:"bio"`
|
||||
}
|
||||
|
||||
// GetName returns Author.Name, and is useful for accessing the field via an interface.
|
||||
func (v *Author) GetName() string { return v.Name }
|
||||
|
||||
// GetEmail returns Author.Email, and is useful for accessing the field via an interface.
|
||||
func (v *Author) GetEmail() string { return v.Email }
|
||||
|
||||
// GetBio returns Author.Bio, and is useful for accessing the field via an interface.
|
||||
func (v *Author) GetBio() string { return v.Bio }
|
||||
|
||||
// Fragment for featured image
|
||||
type FeaturedImage struct {
|
||||
Name string `json:"name"`
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
// GetName returns FeaturedImage.Name, and is useful for accessing the field via an interface.
|
||||
func (v *FeaturedImage) GetName() string { return v.Name }
|
||||
|
||||
// GetUrl returns FeaturedImage.Url, and is useful for accessing the field via an interface.
|
||||
func (v *FeaturedImage) GetUrl() string { return v.Url }
|
||||
|
||||
// GetAllAuthorsResponse is returned by GetAllAuthors on success.
|
||||
type GetAllAuthorsResponse struct {
|
||||
Authors []Author `json:"authors"`
|
||||
}
|
||||
|
||||
// GetAuthors returns GetAllAuthorsResponse.Authors, and is useful for accessing the field via an interface.
|
||||
func (v *GetAllAuthorsResponse) GetAuthors() []Author { return v.Authors }
|
||||
|
||||
// GetAllPostsResponse is returned by GetAllPosts on success.
|
||||
type GetAllPostsResponse struct {
|
||||
Posts []Post `json:"posts"`
|
||||
}
|
||||
|
||||
// GetPosts returns GetAllPostsResponse.Posts, and is useful for accessing the field via an interface.
|
||||
func (v *GetAllPostsResponse) GetPosts() []Post { return v.Posts }
|
||||
|
||||
// GetAllTagsResponse is returned by GetAllTags on success.
|
||||
type GetAllTagsResponse struct {
|
||||
Tags []Tag `json:"tags"`
|
||||
}
|
||||
|
||||
// GetTags returns GetAllTagsResponse.Tags, and is useful for accessing the field via an interface.
|
||||
func (v *GetAllTagsResponse) GetTags() []Tag { return v.Tags }
|
||||
|
||||
// GetFeaturedPostsResponse is returned by GetFeaturedPosts on success.
|
||||
type GetFeaturedPostsResponse struct {
|
||||
Posts []PostSummary `json:"posts"`
|
||||
}
|
||||
|
||||
// GetPosts returns GetFeaturedPostsResponse.Posts, and is useful for accessing the field via an interface.
|
||||
func (v *GetFeaturedPostsResponse) GetPosts() []PostSummary { return v.Posts }
|
||||
|
||||
// GetPostResponse is returned by GetPost on success.
|
||||
type GetPostResponse struct {
|
||||
Posts []Post `json:"posts"`
|
||||
}
|
||||
|
||||
// GetPosts returns GetPostResponse.Posts, and is useful for accessing the field via an interface.
|
||||
func (v *GetPostResponse) GetPosts() []Post { return v.Posts }
|
||||
|
||||
// GetPostSummariesResponse is returned by GetPostSummaries on success.
|
||||
type GetPostSummariesResponse struct {
|
||||
Posts []PostSummary `json:"posts"`
|
||||
}
|
||||
|
||||
// GetPosts returns GetPostSummariesResponse.Posts, and is useful for accessing the field via an interface.
|
||||
func (v *GetPostSummariesResponse) GetPosts() []PostSummary { return v.Posts }
|
||||
|
||||
// GetPostsByTagResponse is returned by GetPostsByTag on success.
|
||||
type GetPostsByTagResponse struct {
|
||||
Posts []PostSummary `json:"posts"`
|
||||
}
|
||||
|
||||
// GetPosts returns GetPostsByTagResponse.Posts, and is useful for accessing the field via an interface.
|
||||
func (v *GetPostsByTagResponse) GetPosts() []PostSummary { return v.Posts }
|
||||
|
||||
// Fragment for full post content
|
||||
type Post struct {
|
||||
Title string `json:"title"`
|
||||
Slug string `json:"slug"`
|
||||
MetaTitle string `json:"meta_title"`
|
||||
MetaDescription string `json:"meta_description"`
|
||||
Featured bool `json:"featured"`
|
||||
ReadingTime int `json:"reading_time"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Author Author `json:"author"`
|
||||
Tags []Tag `json:"tags"`
|
||||
Excerpt string `json:"excerpt"`
|
||||
Content string `json:"content"`
|
||||
FeaturedImage FeaturedImage `json:"featured_image"`
|
||||
}
|
||||
|
||||
// GetTitle returns Post.Title, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetTitle() string { return v.Title }
|
||||
|
||||
// GetSlug returns Post.Slug, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetSlug() string { return v.Slug }
|
||||
|
||||
// GetMetaTitle returns Post.MetaTitle, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetMetaTitle() string { return v.MetaTitle }
|
||||
|
||||
// GetMetaDescription returns Post.MetaDescription, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetMetaDescription() string { return v.MetaDescription }
|
||||
|
||||
// GetFeatured returns Post.Featured, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetFeatured() bool { return v.Featured }
|
||||
|
||||
// GetReadingTime returns Post.ReadingTime, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetReadingTime() int { return v.ReadingTime }
|
||||
|
||||
// GetCreatedAt returns Post.CreatedAt, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetCreatedAt() time.Time { return v.CreatedAt }
|
||||
|
||||
// GetUpdatedAt returns Post.UpdatedAt, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetUpdatedAt() time.Time { return v.UpdatedAt }
|
||||
|
||||
// GetAuthor returns Post.Author, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetAuthor() Author { return v.Author }
|
||||
|
||||
// GetTags returns Post.Tags, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetTags() []Tag { return v.Tags }
|
||||
|
||||
// GetExcerpt returns Post.Excerpt, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetExcerpt() string { return v.Excerpt }
|
||||
|
||||
// GetContent returns Post.Content, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetContent() string { return v.Content }
|
||||
|
||||
// GetFeaturedImage returns Post.FeaturedImage, and is useful for accessing the field via an interface.
|
||||
func (v *Post) GetFeaturedImage() FeaturedImage { return v.FeaturedImage }
|
||||
|
||||
// Fragment for post summary
|
||||
type PostSummary struct {
|
||||
Title string `json:"title"`
|
||||
Slug string `json:"slug"`
|
||||
Featured bool `json:"featured"`
|
||||
ReadingTime int `json:"reading_time"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Author Author `json:"author"`
|
||||
Tags []Tag `json:"tags"`
|
||||
Excerpt string `json:"excerpt"`
|
||||
FeaturedImage FeaturedImage `json:"featured_image"`
|
||||
}
|
||||
|
||||
// GetTitle returns PostSummary.Title, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetTitle() string { return v.Title }
|
||||
|
||||
// GetSlug returns PostSummary.Slug, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetSlug() string { return v.Slug }
|
||||
|
||||
// GetFeatured returns PostSummary.Featured, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetFeatured() bool { return v.Featured }
|
||||
|
||||
// GetReadingTime returns PostSummary.ReadingTime, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetReadingTime() int { return v.ReadingTime }
|
||||
|
||||
// GetCreatedAt returns PostSummary.CreatedAt, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetCreatedAt() time.Time { return v.CreatedAt }
|
||||
|
||||
// GetUpdatedAt returns PostSummary.UpdatedAt, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetUpdatedAt() time.Time { return v.UpdatedAt }
|
||||
|
||||
// GetAuthor returns PostSummary.Author, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetAuthor() Author { return v.Author }
|
||||
|
||||
// GetTags returns PostSummary.Tags, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetTags() []Tag { return v.Tags }
|
||||
|
||||
// GetExcerpt returns PostSummary.Excerpt, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetExcerpt() string { return v.Excerpt }
|
||||
|
||||
// GetFeaturedImage returns PostSummary.FeaturedImage, and is useful for accessing the field via an interface.
|
||||
func (v *PostSummary) GetFeaturedImage() FeaturedImage { return v.FeaturedImage }
|
||||
|
||||
// Fragment for tag
|
||||
type Tag struct {
|
||||
Name string `json:"name"`
|
||||
Slug string `json:"slug"`
|
||||
}
|
||||
|
||||
// GetName returns Tag.Name, and is useful for accessing the field via an interface.
|
||||
func (v *Tag) GetName() string { return v.Name }
|
||||
|
||||
// GetSlug returns Tag.Slug, and is useful for accessing the field via an interface.
|
||||
func (v *Tag) GetSlug() string { return v.Slug }
|
||||
|
||||
// __GetAllAuthorsInput is used internally by genqlient
|
||||
type __GetAllAuthorsInput struct {
|
||||
PageSize int `json:"pageSize"`
|
||||
Page int `json:"page"`
|
||||
}
|
||||
|
||||
// GetPageSize returns __GetAllAuthorsInput.PageSize, and is useful for accessing the field via an interface.
|
||||
func (v *__GetAllAuthorsInput) GetPageSize() int { return v.PageSize }
|
||||
|
||||
// GetPage returns __GetAllAuthorsInput.Page, and is useful for accessing the field via an interface.
|
||||
func (v *__GetAllAuthorsInput) GetPage() int { return v.Page }
|
||||
|
||||
// __GetAllPostsInput is used internally by genqlient
|
||||
type __GetAllPostsInput struct {
|
||||
PageSize int `json:"pageSize"`
|
||||
Page int `json:"page"`
|
||||
}
|
||||
|
||||
// GetPageSize returns __GetAllPostsInput.PageSize, and is useful for accessing the field via an interface.
|
||||
func (v *__GetAllPostsInput) GetPageSize() int { return v.PageSize }
|
||||
|
||||
// GetPage returns __GetAllPostsInput.Page, and is useful for accessing the field via an interface.
|
||||
func (v *__GetAllPostsInput) GetPage() int { return v.Page }
|
||||
|
||||
// __GetFeaturedPostsInput is used internally by genqlient
|
||||
type __GetFeaturedPostsInput struct {
|
||||
PageSize int `json:"pageSize"`
|
||||
Page int `json:"page"`
|
||||
}
|
||||
|
||||
// GetPageSize returns __GetFeaturedPostsInput.PageSize, and is useful for accessing the field via an interface.
|
||||
func (v *__GetFeaturedPostsInput) GetPageSize() int { return v.PageSize }
|
||||
|
||||
// GetPage returns __GetFeaturedPostsInput.Page, and is useful for accessing the field via an interface.
|
||||
func (v *__GetFeaturedPostsInput) GetPage() int { return v.Page }
|
||||
|
||||
// __GetPostInput is used internally by genqlient
|
||||
type __GetPostInput struct {
|
||||
Slug string `json:"slug"`
|
||||
}
|
||||
|
||||
// GetSlug returns __GetPostInput.Slug, and is useful for accessing the field via an interface.
|
||||
func (v *__GetPostInput) GetSlug() string { return v.Slug }
|
||||
|
||||
// __GetPostSummariesInput is used internally by genqlient
|
||||
type __GetPostSummariesInput struct {
|
||||
PageSize int `json:"pageSize"`
|
||||
Page int `json:"page"`
|
||||
}
|
||||
|
||||
// GetPageSize returns __GetPostSummariesInput.PageSize, and is useful for accessing the field via an interface.
|
||||
func (v *__GetPostSummariesInput) GetPageSize() int { return v.PageSize }
|
||||
|
||||
// GetPage returns __GetPostSummariesInput.Page, and is useful for accessing the field via an interface.
|
||||
func (v *__GetPostSummariesInput) GetPage() int { return v.Page }
|
||||
|
||||
// __GetPostsByTagInput is used internally by genqlient
|
||||
type __GetPostsByTagInput struct {
|
||||
Tag string `json:"tag"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Page int `json:"page"`
|
||||
}
|
||||
|
||||
// GetTag returns __GetPostsByTagInput.Tag, and is useful for accessing the field via an interface.
|
||||
func (v *__GetPostsByTagInput) GetTag() string { return v.Tag }
|
||||
|
||||
// GetPageSize returns __GetPostsByTagInput.PageSize, and is useful for accessing the field via an interface.
|
||||
func (v *__GetPostsByTagInput) GetPageSize() int { return v.PageSize }
|
||||
|
||||
// GetPage returns __GetPostsByTagInput.Page, and is useful for accessing the field via an interface.
|
||||
func (v *__GetPostsByTagInput) GetPage() int { return v.Page }
|
||||
|
||||
// The query executed by GetAllAuthors.
|
||||
const GetAllAuthors_Operation = `
|
||||
query GetAllAuthors ($pageSize: Int = 10, $page: Int = 1) {
|
||||
authors(pagination: {pageSize:$pageSize,page:$page}) {
|
||||
... Author
|
||||
}
|
||||
}
|
||||
fragment Author on Author {
|
||||
name
|
||||
email
|
||||
bio
|
||||
}
|
||||
`
|
||||
|
||||
// Gets all authors
|
||||
func GetAllAuthors(
|
||||
ctx_ context.Context,
|
||||
client_ graphql.Client,
|
||||
pageSize int,
|
||||
page int,
|
||||
) (data_ *GetAllAuthorsResponse, err_ error) {
|
||||
req_ := &graphql.Request{
|
||||
OpName: "GetAllAuthors",
|
||||
Query: GetAllAuthors_Operation,
|
||||
Variables: &__GetAllAuthorsInput{
|
||||
PageSize: pageSize,
|
||||
Page: page,
|
||||
},
|
||||
}
|
||||
|
||||
data_ = &GetAllAuthorsResponse{}
|
||||
resp_ := &graphql.Response{Data: data_}
|
||||
|
||||
err_ = client_.MakeRequest(
|
||||
ctx_,
|
||||
req_,
|
||||
resp_,
|
||||
)
|
||||
|
||||
return data_, err_
|
||||
}
|
||||
|
||||
// The query executed by GetAllPosts.
|
||||
const GetAllPosts_Operation = `
|
||||
query GetAllPosts ($pageSize: Int = 10, $page: Int = 1) {
|
||||
posts(pagination: {pageSize:$pageSize,page:$page}) {
|
||||
... Post
|
||||
}
|
||||
}
|
||||
fragment Post on Post {
|
||||
title
|
||||
slug
|
||||
meta_title
|
||||
meta_description
|
||||
featured
|
||||
reading_time
|
||||
createdAt
|
||||
updatedAt
|
||||
author {
|
||||
... Author
|
||||
}
|
||||
tags {
|
||||
... Tag
|
||||
}
|
||||
excerpt
|
||||
content
|
||||
featured_image {
|
||||
... FeaturedImage
|
||||
}
|
||||
}
|
||||
fragment Author on Author {
|
||||
name
|
||||
email
|
||||
bio
|
||||
}
|
||||
fragment Tag on Tag {
|
||||
name
|
||||
slug
|
||||
}
|
||||
fragment FeaturedImage on UploadFile {
|
||||
name
|
||||
url
|
||||
}
|
||||
`
|
||||
|
||||
// Get all posts
|
||||
func GetAllPosts(
|
||||
ctx_ context.Context,
|
||||
client_ graphql.Client,
|
||||
pageSize int,
|
||||
page int,
|
||||
) (data_ *GetAllPostsResponse, err_ error) {
|
||||
req_ := &graphql.Request{
|
||||
OpName: "GetAllPosts",
|
||||
Query: GetAllPosts_Operation,
|
||||
Variables: &__GetAllPostsInput{
|
||||
PageSize: pageSize,
|
||||
Page: page,
|
||||
},
|
||||
}
|
||||
|
||||
data_ = &GetAllPostsResponse{}
|
||||
resp_ := &graphql.Response{Data: data_}
|
||||
|
||||
err_ = client_.MakeRequest(
|
||||
ctx_,
|
||||
req_,
|
||||
resp_,
|
||||
)
|
||||
|
||||
return data_, err_
|
||||
}
|
||||
|
||||
// The query executed by GetAllTags.
|
||||
const GetAllTags_Operation = `
|
||||
query GetAllTags {
|
||||
tags {
|
||||
... Tag
|
||||
}
|
||||
}
|
||||
fragment Tag on Tag {
|
||||
name
|
||||
slug
|
||||
}
|
||||
`
|
||||
|
||||
// Get all tags
|
||||
func GetAllTags(
|
||||
ctx_ context.Context,
|
||||
client_ graphql.Client,
|
||||
) (data_ *GetAllTagsResponse, err_ error) {
|
||||
req_ := &graphql.Request{
|
||||
OpName: "GetAllTags",
|
||||
Query: GetAllTags_Operation,
|
||||
}
|
||||
|
||||
data_ = &GetAllTagsResponse{}
|
||||
resp_ := &graphql.Response{Data: data_}
|
||||
|
||||
err_ = client_.MakeRequest(
|
||||
ctx_,
|
||||
req_,
|
||||
resp_,
|
||||
)
|
||||
|
||||
return data_, err_
|
||||
}
|
||||
|
||||
// The query executed by GetFeaturedPosts.
|
||||
const GetFeaturedPosts_Operation = `
|
||||
query GetFeaturedPosts ($pageSize: Int = 10, $page: Int = 1) {
|
||||
posts(pagination: {pageSize:$pageSize,page:$page}, filters: {featured:{eq:true}}) {
|
||||
... PostSummary
|
||||
}
|
||||
}
|
||||
fragment PostSummary on Post {
|
||||
title
|
||||
slug
|
||||
featured
|
||||
reading_time
|
||||
createdAt
|
||||
updatedAt
|
||||
author {
|
||||
... Author
|
||||
}
|
||||
tags {
|
||||
... Tag
|
||||
}
|
||||
excerpt
|
||||
featured_image {
|
||||
... FeaturedImage
|
||||
}
|
||||
}
|
||||
fragment Author on Author {
|
||||
name
|
||||
email
|
||||
bio
|
||||
}
|
||||
fragment Tag on Tag {
|
||||
name
|
||||
slug
|
||||
}
|
||||
fragment FeaturedImage on UploadFile {
|
||||
name
|
||||
url
|
||||
}
|
||||
`
|
||||
|
||||
// Get featured posts
|
||||
func GetFeaturedPosts(
|
||||
ctx_ context.Context,
|
||||
client_ graphql.Client,
|
||||
pageSize int,
|
||||
page int,
|
||||
) (data_ *GetFeaturedPostsResponse, err_ error) {
|
||||
req_ := &graphql.Request{
|
||||
OpName: "GetFeaturedPosts",
|
||||
Query: GetFeaturedPosts_Operation,
|
||||
Variables: &__GetFeaturedPostsInput{
|
||||
PageSize: pageSize,
|
||||
Page: page,
|
||||
},
|
||||
}
|
||||
|
||||
data_ = &GetFeaturedPostsResponse{}
|
||||
resp_ := &graphql.Response{Data: data_}
|
||||
|
||||
err_ = client_.MakeRequest(
|
||||
ctx_,
|
||||
req_,
|
||||
resp_,
|
||||
)
|
||||
|
||||
return data_, err_
|
||||
}
|
||||
|
||||
// The query executed by GetPost.
|
||||
const GetPost_Operation = `
|
||||
query GetPost ($slug: String!) {
|
||||
posts(filters: {slug:{eq:$slug}}) {
|
||||
... Post
|
||||
}
|
||||
}
|
||||
fragment Post on Post {
|
||||
title
|
||||
slug
|
||||
meta_title
|
||||
meta_description
|
||||
featured
|
||||
reading_time
|
||||
createdAt
|
||||
updatedAt
|
||||
author {
|
||||
... Author
|
||||
}
|
||||
tags {
|
||||
... Tag
|
||||
}
|
||||
excerpt
|
||||
content
|
||||
featured_image {
|
||||
... FeaturedImage
|
||||
}
|
||||
}
|
||||
fragment Author on Author {
|
||||
name
|
||||
email
|
||||
bio
|
||||
}
|
||||
fragment Tag on Tag {
|
||||
name
|
||||
slug
|
||||
}
|
||||
fragment FeaturedImage on UploadFile {
|
||||
name
|
||||
url
|
||||
}
|
||||
`
|
||||
|
||||
// Get specific post (by slug)
|
||||
func GetPost(
|
||||
ctx_ context.Context,
|
||||
client_ graphql.Client,
|
||||
slug string,
|
||||
) (data_ *GetPostResponse, err_ error) {
|
||||
req_ := &graphql.Request{
|
||||
OpName: "GetPost",
|
||||
Query: GetPost_Operation,
|
||||
Variables: &__GetPostInput{
|
||||
Slug: slug,
|
||||
},
|
||||
}
|
||||
|
||||
data_ = &GetPostResponse{}
|
||||
resp_ := &graphql.Response{Data: data_}
|
||||
|
||||
err_ = client_.MakeRequest(
|
||||
ctx_,
|
||||
req_,
|
||||
resp_,
|
||||
)
|
||||
|
||||
return data_, err_
|
||||
}
|
||||
|
||||
// The query executed by GetPostSummaries.
|
||||
const GetPostSummaries_Operation = `
|
||||
query GetPostSummaries ($pageSize: Int = 10, $page: Int = 1) {
|
||||
posts(pagination: {pageSize:$pageSize,page:$page}) {
|
||||
... PostSummary
|
||||
}
|
||||
}
|
||||
fragment PostSummary on Post {
|
||||
title
|
||||
slug
|
||||
featured
|
||||
reading_time
|
||||
createdAt
|
||||
updatedAt
|
||||
author {
|
||||
... Author
|
||||
}
|
||||
tags {
|
||||
... Tag
|
||||
}
|
||||
excerpt
|
||||
featured_image {
|
||||
... FeaturedImage
|
||||
}
|
||||
}
|
||||
fragment Author on Author {
|
||||
name
|
||||
email
|
||||
bio
|
||||
}
|
||||
fragment Tag on Tag {
|
||||
name
|
||||
slug
|
||||
}
|
||||
fragment FeaturedImage on UploadFile {
|
||||
name
|
||||
url
|
||||
}
|
||||
`
|
||||
|
||||
// Get post summaries
|
||||
func GetPostSummaries(
|
||||
ctx_ context.Context,
|
||||
client_ graphql.Client,
|
||||
pageSize int,
|
||||
page int,
|
||||
) (data_ *GetPostSummariesResponse, err_ error) {
|
||||
req_ := &graphql.Request{
|
||||
OpName: "GetPostSummaries",
|
||||
Query: GetPostSummaries_Operation,
|
||||
Variables: &__GetPostSummariesInput{
|
||||
PageSize: pageSize,
|
||||
Page: page,
|
||||
},
|
||||
}
|
||||
|
||||
data_ = &GetPostSummariesResponse{}
|
||||
resp_ := &graphql.Response{Data: data_}
|
||||
|
||||
err_ = client_.MakeRequest(
|
||||
ctx_,
|
||||
req_,
|
||||
resp_,
|
||||
)
|
||||
|
||||
return data_, err_
|
||||
}
|
||||
|
||||
// The query executed by GetPostsByTag.
|
||||
const GetPostsByTag_Operation = `
|
||||
query GetPostsByTag ($tag: String!, $pageSize: Int = 10, $page: Int = 1) {
|
||||
posts(pagination: {pageSize:$pageSize,page:$page}, filters: {tags:{slug:{eq:$tag}}}) {
|
||||
... PostSummary
|
||||
}
|
||||
}
|
||||
fragment PostSummary on Post {
|
||||
title
|
||||
slug
|
||||
featured
|
||||
reading_time
|
||||
createdAt
|
||||
updatedAt
|
||||
author {
|
||||
... Author
|
||||
}
|
||||
tags {
|
||||
... Tag
|
||||
}
|
||||
excerpt
|
||||
featured_image {
|
||||
... FeaturedImage
|
||||
}
|
||||
}
|
||||
fragment Author on Author {
|
||||
name
|
||||
email
|
||||
bio
|
||||
}
|
||||
fragment Tag on Tag {
|
||||
name
|
||||
slug
|
||||
}
|
||||
fragment FeaturedImage on UploadFile {
|
||||
name
|
||||
url
|
||||
}
|
||||
`
|
||||
|
||||
// Get posts by tag (slug)
|
||||
func GetPostsByTag(
|
||||
ctx_ context.Context,
|
||||
client_ graphql.Client,
|
||||
tag string,
|
||||
pageSize int,
|
||||
page int,
|
||||
) (data_ *GetPostsByTagResponse, err_ error) {
|
||||
req_ := &graphql.Request{
|
||||
OpName: "GetPostsByTag",
|
||||
Query: GetPostsByTag_Operation,
|
||||
Variables: &__GetPostsByTagInput{
|
||||
Tag: tag,
|
||||
PageSize: pageSize,
|
||||
Page: page,
|
||||
},
|
||||
}
|
||||
|
||||
data_ = &GetPostsByTagResponse{}
|
||||
resp_ := &graphql.Response{Data: data_}
|
||||
|
||||
err_ = client_.MakeRequest(
|
||||
ctx_,
|
||||
req_,
|
||||
resp_,
|
||||
)
|
||||
|
||||
return data_, err_
|
||||
}
|
||||
15
internal/strapi/queries/author_queries.graphql
Normal file
15
internal/strapi/queries/author_queries.graphql
Normal file
@@ -0,0 +1,15 @@
|
||||
# Fragment for authors
|
||||
fragment Author on Author {
|
||||
name
|
||||
email
|
||||
bio
|
||||
}
|
||||
|
||||
|
||||
# Gets all authors
|
||||
query GetAllAuthors($pageSize: Int = 10, $page: Int = 1) {
|
||||
# @genqlient(flatten: true)
|
||||
authors(pagination: { pageSize: $pageSize, page: $page }) {
|
||||
...Author
|
||||
}
|
||||
}
|
||||
100
internal/strapi/queries/post_queries.graphql
Normal file
100
internal/strapi/queries/post_queries.graphql
Normal file
@@ -0,0 +1,100 @@
|
||||
# Fragment for full post content
|
||||
fragment Post on Post {
|
||||
title
|
||||
slug
|
||||
meta_title
|
||||
meta_description
|
||||
featured
|
||||
reading_time
|
||||
createdAt
|
||||
updatedAt
|
||||
# @genqlient(flatten: true)
|
||||
author {
|
||||
...Author
|
||||
}
|
||||
# @genqlient(flatten: true)
|
||||
tags {
|
||||
...Tag
|
||||
}
|
||||
excerpt
|
||||
content
|
||||
# @genqlient(flatten: true)
|
||||
featured_image {
|
||||
...FeaturedImage
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Fragment for post summary
|
||||
fragment PostSummary on Post {
|
||||
title
|
||||
slug
|
||||
featured
|
||||
reading_time
|
||||
createdAt
|
||||
updatedAt
|
||||
# @genqlient(flatten: true)
|
||||
author {
|
||||
...Author
|
||||
}
|
||||
# @genqlient(flatten: true)
|
||||
tags {
|
||||
...Tag
|
||||
}
|
||||
excerpt
|
||||
# @genqlient(flatten: true)
|
||||
featured_image {
|
||||
...FeaturedImage
|
||||
}
|
||||
}
|
||||
|
||||
# Fragment for featured image
|
||||
fragment FeaturedImage on UploadFile {
|
||||
name
|
||||
url
|
||||
}
|
||||
|
||||
# Get all posts
|
||||
query GetAllPosts($pageSize: Int = 10, $page: Int = 1) {
|
||||
# @genqlient(flatten: true)
|
||||
posts(pagination: { pageSize: $pageSize, page: $page }) {
|
||||
...Post
|
||||
}
|
||||
}
|
||||
|
||||
# Get featured posts
|
||||
query GetFeaturedPosts($pageSize: Int = 10, $page: Int = 1) {
|
||||
# @genqlient(flatten: true)
|
||||
posts(pagination: { pageSize: $pageSize, page: $page }
|
||||
filters: { featured: { eq: true } }
|
||||
) {
|
||||
...PostSummary
|
||||
}
|
||||
}
|
||||
|
||||
# Get specific post (by slug)
|
||||
query GetPost($slug: String!) {
|
||||
# @genqlient(flatten: true)
|
||||
posts(filters: { slug: { eq: $slug } }) {
|
||||
...Post
|
||||
}
|
||||
}
|
||||
|
||||
# Get post summaries
|
||||
query GetPostSummaries($pageSize: Int = 10, $page: Int = 1) {
|
||||
# @genqlient(flatten: true)
|
||||
posts(pagination: { pageSize: $pageSize, page: $page }) {
|
||||
...PostSummary
|
||||
}
|
||||
}
|
||||
|
||||
# Get posts by tag (slug)
|
||||
query GetPostsByTag($tag: String!,$pageSize: Int = 10, $page: Int = 1) {
|
||||
# @genqlient(flatten: true)
|
||||
posts(
|
||||
pagination: { pageSize: $pageSize, page: $page },
|
||||
filters: { tags: { slug: { eq: $tag } } }
|
||||
) {
|
||||
...PostSummary
|
||||
}
|
||||
}
|
||||
13
internal/strapi/queries/tag_queries.graphql
Normal file
13
internal/strapi/queries/tag_queries.graphql
Normal file
@@ -0,0 +1,13 @@
|
||||
# Fragment for tag
|
||||
fragment Tag on Tag {
|
||||
name
|
||||
slug
|
||||
}
|
||||
|
||||
# Get all tags
|
||||
query GetAllTags {
|
||||
# @genqlient(flatten: true)
|
||||
tags {
|
||||
...Tag
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,816 @@
|
||||
"""
|
||||
Indicates exactly one field must be supplied and this field must not be `null`.
|
||||
"""
|
||||
directive @oneOf on INPUT_OBJECT
|
||||
|
||||
"""
|
||||
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
|
||||
"""
|
||||
scalar JSON
|
||||
|
||||
"""
|
||||
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
|
||||
"""
|
||||
scalar DateTime
|
||||
|
||||
type Pagination {
|
||||
total: Int!
|
||||
page: Int!
|
||||
pageSize: Int!
|
||||
pageCount: Int!
|
||||
}
|
||||
|
||||
type DeleteMutationResponse {
|
||||
documentId: ID!
|
||||
}
|
||||
|
||||
enum PublicationStatus {
|
||||
DRAFT
|
||||
PUBLISHED
|
||||
}
|
||||
|
||||
input IDFilterInput {
|
||||
and: [ID]
|
||||
or: [ID]
|
||||
not: IDFilterInput
|
||||
eq: ID
|
||||
eqi: ID
|
||||
ne: ID
|
||||
nei: ID
|
||||
startsWith: ID
|
||||
endsWith: ID
|
||||
contains: ID
|
||||
notContains: ID
|
||||
containsi: ID
|
||||
notContainsi: ID
|
||||
gt: ID
|
||||
gte: ID
|
||||
lt: ID
|
||||
lte: ID
|
||||
null: Boolean
|
||||
notNull: Boolean
|
||||
in: [ID]
|
||||
notIn: [ID]
|
||||
between: [ID]
|
||||
}
|
||||
|
||||
input BooleanFilterInput {
|
||||
and: [Boolean]
|
||||
or: [Boolean]
|
||||
not: BooleanFilterInput
|
||||
eq: Boolean
|
||||
eqi: Boolean
|
||||
ne: Boolean
|
||||
nei: Boolean
|
||||
startsWith: Boolean
|
||||
endsWith: Boolean
|
||||
contains: Boolean
|
||||
notContains: Boolean
|
||||
containsi: Boolean
|
||||
notContainsi: Boolean
|
||||
gt: Boolean
|
||||
gte: Boolean
|
||||
lt: Boolean
|
||||
lte: Boolean
|
||||
null: Boolean
|
||||
notNull: Boolean
|
||||
in: [Boolean]
|
||||
notIn: [Boolean]
|
||||
between: [Boolean]
|
||||
}
|
||||
|
||||
input StringFilterInput {
|
||||
and: [String]
|
||||
or: [String]
|
||||
not: StringFilterInput
|
||||
eq: String
|
||||
eqi: String
|
||||
ne: String
|
||||
nei: String
|
||||
startsWith: String
|
||||
endsWith: String
|
||||
contains: String
|
||||
notContains: String
|
||||
containsi: String
|
||||
notContainsi: String
|
||||
gt: String
|
||||
gte: String
|
||||
lt: String
|
||||
lte: String
|
||||
null: Boolean
|
||||
notNull: Boolean
|
||||
in: [String]
|
||||
notIn: [String]
|
||||
between: [String]
|
||||
}
|
||||
|
||||
input IntFilterInput {
|
||||
and: [Int]
|
||||
or: [Int]
|
||||
not: IntFilterInput
|
||||
eq: Int
|
||||
eqi: Int
|
||||
ne: Int
|
||||
nei: Int
|
||||
startsWith: Int
|
||||
endsWith: Int
|
||||
contains: Int
|
||||
notContains: Int
|
||||
containsi: Int
|
||||
notContainsi: Int
|
||||
gt: Int
|
||||
gte: Int
|
||||
lt: Int
|
||||
lte: Int
|
||||
null: Boolean
|
||||
notNull: Boolean
|
||||
in: [Int]
|
||||
notIn: [Int]
|
||||
between: [Int]
|
||||
}
|
||||
|
||||
input FloatFilterInput {
|
||||
and: [Float]
|
||||
or: [Float]
|
||||
not: FloatFilterInput
|
||||
eq: Float
|
||||
eqi: Float
|
||||
ne: Float
|
||||
nei: Float
|
||||
startsWith: Float
|
||||
endsWith: Float
|
||||
contains: Float
|
||||
notContains: Float
|
||||
containsi: Float
|
||||
notContainsi: Float
|
||||
gt: Float
|
||||
gte: Float
|
||||
lt: Float
|
||||
lte: Float
|
||||
null: Boolean
|
||||
notNull: Boolean
|
||||
in: [Float]
|
||||
notIn: [Float]
|
||||
between: [Float]
|
||||
}
|
||||
|
||||
input DateTimeFilterInput {
|
||||
and: [DateTime]
|
||||
or: [DateTime]
|
||||
not: DateTimeFilterInput
|
||||
eq: DateTime
|
||||
eqi: DateTime
|
||||
ne: DateTime
|
||||
nei: DateTime
|
||||
startsWith: DateTime
|
||||
endsWith: DateTime
|
||||
contains: DateTime
|
||||
notContains: DateTime
|
||||
containsi: DateTime
|
||||
notContainsi: DateTime
|
||||
gt: DateTime
|
||||
gte: DateTime
|
||||
lt: DateTime
|
||||
lte: DateTime
|
||||
null: Boolean
|
||||
notNull: Boolean
|
||||
in: [DateTime]
|
||||
notIn: [DateTime]
|
||||
between: [DateTime]
|
||||
}
|
||||
|
||||
input JSONFilterInput {
|
||||
and: [JSON]
|
||||
or: [JSON]
|
||||
not: JSONFilterInput
|
||||
eq: JSON
|
||||
eqi: JSON
|
||||
ne: JSON
|
||||
nei: JSON
|
||||
startsWith: JSON
|
||||
endsWith: JSON
|
||||
contains: JSON
|
||||
notContains: JSON
|
||||
containsi: JSON
|
||||
notContainsi: JSON
|
||||
gt: JSON
|
||||
gte: JSON
|
||||
lt: JSON
|
||||
lte: JSON
|
||||
null: Boolean
|
||||
notNull: Boolean
|
||||
in: [JSON]
|
||||
notIn: [JSON]
|
||||
between: [JSON]
|
||||
}
|
||||
|
||||
type ComponentSharedSlider {
|
||||
id: ID!
|
||||
files_connection(filters: UploadFileFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): UploadFileRelationResponseCollection
|
||||
files(filters: UploadFileFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [UploadFile]!
|
||||
}
|
||||
|
||||
type ComponentSharedSeo {
|
||||
id: ID!
|
||||
metaTitle: String!
|
||||
metaDescription: String!
|
||||
shareImage: UploadFile
|
||||
}
|
||||
|
||||
type ComponentSharedRichText {
|
||||
id: ID!
|
||||
body: String
|
||||
}
|
||||
|
||||
type ComponentSharedQuote {
|
||||
id: ID!
|
||||
title: String
|
||||
body: String
|
||||
}
|
||||
|
||||
type ComponentSharedMedia {
|
||||
id: ID!
|
||||
file: UploadFile
|
||||
}
|
||||
|
||||
input UploadFileFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
name: StringFilterInput
|
||||
alternativeText: StringFilterInput
|
||||
caption: StringFilterInput
|
||||
focalPoint: JSONFilterInput
|
||||
width: IntFilterInput
|
||||
height: IntFilterInput
|
||||
formats: JSONFilterInput
|
||||
hash: StringFilterInput
|
||||
ext: StringFilterInput
|
||||
mime: StringFilterInput
|
||||
size: FloatFilterInput
|
||||
url: StringFilterInput
|
||||
previewUrl: StringFilterInput
|
||||
provider: StringFilterInput
|
||||
provider_metadata: JSONFilterInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [UploadFileFiltersInput]
|
||||
or: [UploadFileFiltersInput]
|
||||
not: UploadFileFiltersInput
|
||||
}
|
||||
|
||||
type UploadFile {
|
||||
documentId: ID!
|
||||
name: String!
|
||||
alternativeText: String
|
||||
caption: String
|
||||
focalPoint: JSON
|
||||
width: Int
|
||||
height: Int
|
||||
formats: JSON
|
||||
hash: String!
|
||||
ext: String
|
||||
mime: String!
|
||||
size: Float!
|
||||
url: String!
|
||||
previewUrl: String
|
||||
provider: String!
|
||||
provider_metadata: JSON
|
||||
related: [GenericMorph]
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type UploadFileEntityResponseCollection {
|
||||
nodes: [UploadFile!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
type UploadFileRelationResponseCollection {
|
||||
nodes: [UploadFile!]!
|
||||
}
|
||||
|
||||
input I18NLocaleFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
name: StringFilterInput
|
||||
code: StringFilterInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [I18NLocaleFiltersInput]
|
||||
or: [I18NLocaleFiltersInput]
|
||||
not: I18NLocaleFiltersInput
|
||||
}
|
||||
|
||||
type I18NLocale {
|
||||
documentId: ID!
|
||||
name: String
|
||||
code: String
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type I18NLocaleEntityResponseCollection {
|
||||
nodes: [I18NLocale!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
input ReviewWorkflowsWorkflowFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
name: StringFilterInput
|
||||
stages: ReviewWorkflowsWorkflowStageFiltersInput
|
||||
stageRequiredToPublish: ReviewWorkflowsWorkflowStageFiltersInput
|
||||
contentTypes: JSONFilterInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [ReviewWorkflowsWorkflowFiltersInput]
|
||||
or: [ReviewWorkflowsWorkflowFiltersInput]
|
||||
not: ReviewWorkflowsWorkflowFiltersInput
|
||||
}
|
||||
|
||||
input ReviewWorkflowsWorkflowInput {
|
||||
name: String
|
||||
stages: [ID]
|
||||
stageRequiredToPublish: ID
|
||||
contentTypes: JSON
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type ReviewWorkflowsWorkflow {
|
||||
documentId: ID!
|
||||
name: String!
|
||||
stages_connection(filters: ReviewWorkflowsWorkflowStageFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): ReviewWorkflowsWorkflowStageRelationResponseCollection
|
||||
stages(filters: ReviewWorkflowsWorkflowStageFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [ReviewWorkflowsWorkflowStage]!
|
||||
stageRequiredToPublish: ReviewWorkflowsWorkflowStage
|
||||
contentTypes: JSON!
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type ReviewWorkflowsWorkflowEntityResponseCollection {
|
||||
nodes: [ReviewWorkflowsWorkflow!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
input ReviewWorkflowsWorkflowStageFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
name: StringFilterInput
|
||||
color: StringFilterInput
|
||||
workflow: ReviewWorkflowsWorkflowFiltersInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [ReviewWorkflowsWorkflowStageFiltersInput]
|
||||
or: [ReviewWorkflowsWorkflowStageFiltersInput]
|
||||
not: ReviewWorkflowsWorkflowStageFiltersInput
|
||||
}
|
||||
|
||||
input ReviewWorkflowsWorkflowStageInput {
|
||||
name: String
|
||||
color: String
|
||||
workflow: ID
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type ReviewWorkflowsWorkflowStage {
|
||||
documentId: ID!
|
||||
name: String
|
||||
color: String
|
||||
workflow: ReviewWorkflowsWorkflow
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type ReviewWorkflowsWorkflowStageEntityResponseCollection {
|
||||
nodes: [ReviewWorkflowsWorkflowStage!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
type ReviewWorkflowsWorkflowStageRelationResponseCollection {
|
||||
nodes: [ReviewWorkflowsWorkflowStage!]!
|
||||
}
|
||||
|
||||
input UsersPermissionsPermissionFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
action: StringFilterInput
|
||||
role: UsersPermissionsRoleFiltersInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [UsersPermissionsPermissionFiltersInput]
|
||||
or: [UsersPermissionsPermissionFiltersInput]
|
||||
not: UsersPermissionsPermissionFiltersInput
|
||||
}
|
||||
|
||||
type UsersPermissionsPermission {
|
||||
documentId: ID!
|
||||
action: String!
|
||||
role: UsersPermissionsRole
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type UsersPermissionsPermissionRelationResponseCollection {
|
||||
nodes: [UsersPermissionsPermission!]!
|
||||
}
|
||||
|
||||
input UsersPermissionsRoleFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
name: StringFilterInput
|
||||
description: StringFilterInput
|
||||
type: StringFilterInput
|
||||
permissions: UsersPermissionsPermissionFiltersInput
|
||||
users: UsersPermissionsUserFiltersInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [UsersPermissionsRoleFiltersInput]
|
||||
or: [UsersPermissionsRoleFiltersInput]
|
||||
not: UsersPermissionsRoleFiltersInput
|
||||
}
|
||||
|
||||
input UsersPermissionsRoleInput {
|
||||
name: String
|
||||
description: String
|
||||
type: String
|
||||
permissions: [ID]
|
||||
users: [ID]
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type UsersPermissionsRole {
|
||||
documentId: ID!
|
||||
name: String!
|
||||
description: String
|
||||
type: String
|
||||
permissions_connection(filters: UsersPermissionsPermissionFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): UsersPermissionsPermissionRelationResponseCollection
|
||||
permissions(filters: UsersPermissionsPermissionFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [UsersPermissionsPermission]!
|
||||
users_connection(filters: UsersPermissionsUserFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): UsersPermissionsUserRelationResponseCollection
|
||||
users(filters: UsersPermissionsUserFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [UsersPermissionsUser]!
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type UsersPermissionsRoleEntityResponseCollection {
|
||||
nodes: [UsersPermissionsRole!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
input UsersPermissionsUserFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
username: StringFilterInput
|
||||
email: StringFilterInput
|
||||
provider: StringFilterInput
|
||||
confirmed: BooleanFilterInput
|
||||
blocked: BooleanFilterInput
|
||||
role: UsersPermissionsRoleFiltersInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [UsersPermissionsUserFiltersInput]
|
||||
or: [UsersPermissionsUserFiltersInput]
|
||||
not: UsersPermissionsUserFiltersInput
|
||||
}
|
||||
|
||||
input UsersPermissionsUserInput {
|
||||
username: String
|
||||
email: String
|
||||
provider: String
|
||||
confirmed: Boolean
|
||||
blocked: Boolean
|
||||
role: ID
|
||||
publishedAt: DateTime
|
||||
password: String
|
||||
}
|
||||
|
||||
type UsersPermissionsUser {
|
||||
documentId: ID!
|
||||
username: String!
|
||||
email: String!
|
||||
provider: String
|
||||
confirmed: Boolean
|
||||
blocked: Boolean
|
||||
role: UsersPermissionsRole
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type UsersPermissionsUserEntityResponse {
|
||||
data: UsersPermissionsUser
|
||||
}
|
||||
|
||||
type UsersPermissionsUserEntityResponseCollection {
|
||||
nodes: [UsersPermissionsUser!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
type UsersPermissionsUserRelationResponseCollection {
|
||||
nodes: [UsersPermissionsUser!]!
|
||||
}
|
||||
|
||||
input AuthorFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
name: StringFilterInput
|
||||
email: StringFilterInput
|
||||
bio: StringFilterInput
|
||||
social_links: JSONFilterInput
|
||||
posts: PostFiltersInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [AuthorFiltersInput]
|
||||
or: [AuthorFiltersInput]
|
||||
not: AuthorFiltersInput
|
||||
}
|
||||
|
||||
input AuthorInput {
|
||||
name: String
|
||||
email: String
|
||||
bio: String
|
||||
avatar: ID
|
||||
social_links: JSON
|
||||
posts: [ID]
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type Author {
|
||||
documentId: ID!
|
||||
name: String!
|
||||
email: String!
|
||||
bio: String
|
||||
avatar: UploadFile
|
||||
social_links: JSON
|
||||
posts_connection(filters: PostFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): PostRelationResponseCollection
|
||||
posts(filters: PostFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [Post]!
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type AuthorEntityResponseCollection {
|
||||
nodes: [Author!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
input PostFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
title: StringFilterInput
|
||||
slug: StringFilterInput
|
||||
content: StringFilterInput
|
||||
excerpt: StringFilterInput
|
||||
featured: BooleanFilterInput
|
||||
meta_title: StringFilterInput
|
||||
meta_description: StringFilterInput
|
||||
reading_time: IntFilterInput
|
||||
tags: TagFiltersInput
|
||||
author: AuthorFiltersInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [PostFiltersInput]
|
||||
or: [PostFiltersInput]
|
||||
not: PostFiltersInput
|
||||
}
|
||||
|
||||
input PostInput {
|
||||
title: String
|
||||
slug: String
|
||||
content: String
|
||||
excerpt: String
|
||||
featured_image: ID
|
||||
featured: Boolean
|
||||
meta_title: String
|
||||
meta_description: String
|
||||
reading_time: Int
|
||||
tags: [ID]
|
||||
author: ID
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type Post {
|
||||
documentId: ID!
|
||||
title: String!
|
||||
slug: String!
|
||||
content: String!
|
||||
excerpt: String
|
||||
featured_image: UploadFile
|
||||
featured: Boolean
|
||||
meta_title: String
|
||||
meta_description: String
|
||||
reading_time: Int
|
||||
tags_connection(filters: TagFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): TagRelationResponseCollection
|
||||
tags(filters: TagFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [Tag]!
|
||||
author: Author
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type PostEntityResponseCollection {
|
||||
nodes: [Post!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
type PostRelationResponseCollection {
|
||||
nodes: [Post!]!
|
||||
}
|
||||
|
||||
input TagFiltersInput {
|
||||
documentId: IDFilterInput
|
||||
name: StringFilterInput
|
||||
slug: StringFilterInput
|
||||
posts: PostFiltersInput
|
||||
createdAt: DateTimeFilterInput
|
||||
updatedAt: DateTimeFilterInput
|
||||
publishedAt: DateTimeFilterInput
|
||||
and: [TagFiltersInput]
|
||||
or: [TagFiltersInput]
|
||||
not: TagFiltersInput
|
||||
}
|
||||
|
||||
input TagInput {
|
||||
name: String
|
||||
slug: String
|
||||
posts: [ID]
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type Tag {
|
||||
documentId: ID!
|
||||
name: String!
|
||||
slug: String!
|
||||
posts_connection(filters: PostFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): PostRelationResponseCollection
|
||||
posts(filters: PostFiltersInput, pagination: PaginationArg = {}, sort: [String] = []): [Post]!
|
||||
createdAt: DateTime
|
||||
updatedAt: DateTime
|
||||
publishedAt: DateTime
|
||||
}
|
||||
|
||||
type TagEntityResponseCollection {
|
||||
nodes: [Tag!]!
|
||||
pageInfo: Pagination!
|
||||
}
|
||||
|
||||
type TagRelationResponseCollection {
|
||||
nodes: [Tag!]!
|
||||
}
|
||||
|
||||
union GenericMorph = ComponentSharedSlider | ComponentSharedSeo | ComponentSharedRichText | ComponentSharedQuote | ComponentSharedMedia | UploadFile | I18NLocale | ReviewWorkflowsWorkflow | ReviewWorkflowsWorkflowStage | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsUser | Author | Post | Tag
|
||||
|
||||
input FileInfoInput {
|
||||
name: String
|
||||
alternativeText: String
|
||||
caption: String
|
||||
}
|
||||
|
||||
type UsersPermissionsMe {
|
||||
id: ID!
|
||||
documentId: ID!
|
||||
username: String!
|
||||
email: String
|
||||
confirmed: Boolean
|
||||
blocked: Boolean
|
||||
role: UsersPermissionsMeRole
|
||||
}
|
||||
|
||||
type UsersPermissionsMeRole {
|
||||
id: ID!
|
||||
name: String!
|
||||
description: String
|
||||
type: String
|
||||
}
|
||||
|
||||
input UsersPermissionsRegisterInput {
|
||||
username: String!
|
||||
email: String!
|
||||
password: String!
|
||||
}
|
||||
|
||||
input UsersPermissionsLoginInput {
|
||||
identifier: String!
|
||||
password: String!
|
||||
provider: String! = "local"
|
||||
}
|
||||
|
||||
type UsersPermissionsPasswordPayload {
|
||||
ok: Boolean!
|
||||
}
|
||||
|
||||
type UsersPermissionsLoginPayload {
|
||||
jwt: String
|
||||
user: UsersPermissionsMe!
|
||||
}
|
||||
|
||||
type UsersPermissionsCreateRolePayload {
|
||||
ok: Boolean!
|
||||
}
|
||||
|
||||
type UsersPermissionsUpdateRolePayload {
|
||||
ok: Boolean!
|
||||
}
|
||||
|
||||
type UsersPermissionsDeleteRolePayload {
|
||||
ok: Boolean!
|
||||
}
|
||||
|
||||
input PaginationArg {
|
||||
page: Int
|
||||
pageSize: Int
|
||||
start: Int
|
||||
limit: Int
|
||||
}
|
||||
|
||||
type Query {
|
||||
uploadFile(documentId: ID!, status: PublicationStatus = PUBLISHED): UploadFile
|
||||
uploadFiles_connection(filters: UploadFileFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): UploadFileEntityResponseCollection
|
||||
uploadFiles(filters: UploadFileFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [UploadFile]!
|
||||
i18NLocale(documentId: ID!, status: PublicationStatus = PUBLISHED): I18NLocale
|
||||
i18NLocales_connection(filters: I18NLocaleFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): I18NLocaleEntityResponseCollection
|
||||
i18NLocales(filters: I18NLocaleFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [I18NLocale]!
|
||||
reviewWorkflowsWorkflow(documentId: ID!, status: PublicationStatus = PUBLISHED): ReviewWorkflowsWorkflow
|
||||
reviewWorkflowsWorkflows_connection(filters: ReviewWorkflowsWorkflowFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): ReviewWorkflowsWorkflowEntityResponseCollection
|
||||
reviewWorkflowsWorkflows(filters: ReviewWorkflowsWorkflowFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [ReviewWorkflowsWorkflow]!
|
||||
reviewWorkflowsWorkflowStage(documentId: ID!, status: PublicationStatus = PUBLISHED): ReviewWorkflowsWorkflowStage
|
||||
reviewWorkflowsWorkflowStages_connection(filters: ReviewWorkflowsWorkflowStageFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): ReviewWorkflowsWorkflowStageEntityResponseCollection
|
||||
reviewWorkflowsWorkflowStages(filters: ReviewWorkflowsWorkflowStageFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [ReviewWorkflowsWorkflowStage]!
|
||||
usersPermissionsRole(documentId: ID!, status: PublicationStatus = PUBLISHED): UsersPermissionsRole
|
||||
usersPermissionsRoles_connection(filters: UsersPermissionsRoleFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): UsersPermissionsRoleEntityResponseCollection
|
||||
usersPermissionsRoles(filters: UsersPermissionsRoleFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [UsersPermissionsRole]!
|
||||
usersPermissionsUser(documentId: ID!, status: PublicationStatus = PUBLISHED): UsersPermissionsUser
|
||||
usersPermissionsUsers_connection(filters: UsersPermissionsUserFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): UsersPermissionsUserEntityResponseCollection
|
||||
usersPermissionsUsers(filters: UsersPermissionsUserFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [UsersPermissionsUser]!
|
||||
author(documentId: ID!, status: PublicationStatus = PUBLISHED): Author
|
||||
authors_connection(filters: AuthorFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): AuthorEntityResponseCollection
|
||||
authors(filters: AuthorFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [Author]!
|
||||
post(documentId: ID!, status: PublicationStatus = PUBLISHED): Post
|
||||
posts_connection(filters: PostFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): PostEntityResponseCollection
|
||||
posts(filters: PostFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [Post]!
|
||||
tag(documentId: ID!, status: PublicationStatus = PUBLISHED): Tag
|
||||
tags_connection(filters: TagFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): TagEntityResponseCollection
|
||||
tags(filters: TagFiltersInput, pagination: PaginationArg = {}, sort: [String] = [], status: PublicationStatus = PUBLISHED): [Tag]!
|
||||
me: UsersPermissionsMe
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
createReviewWorkflowsWorkflow(status: PublicationStatus = PUBLISHED, data: ReviewWorkflowsWorkflowInput!): ReviewWorkflowsWorkflow
|
||||
updateReviewWorkflowsWorkflow(documentId: ID!, status: PublicationStatus = PUBLISHED, data: ReviewWorkflowsWorkflowInput!): ReviewWorkflowsWorkflow
|
||||
deleteReviewWorkflowsWorkflow(documentId: ID!): DeleteMutationResponse
|
||||
createReviewWorkflowsWorkflowStage(status: PublicationStatus = PUBLISHED, data: ReviewWorkflowsWorkflowStageInput!): ReviewWorkflowsWorkflowStage
|
||||
updateReviewWorkflowsWorkflowStage(documentId: ID!, status: PublicationStatus = PUBLISHED, data: ReviewWorkflowsWorkflowStageInput!): ReviewWorkflowsWorkflowStage
|
||||
deleteReviewWorkflowsWorkflowStage(documentId: ID!): DeleteMutationResponse
|
||||
createAuthor(status: PublicationStatus = PUBLISHED, data: AuthorInput!): Author
|
||||
updateAuthor(documentId: ID!, status: PublicationStatus = PUBLISHED, data: AuthorInput!): Author
|
||||
deleteAuthor(documentId: ID!): DeleteMutationResponse
|
||||
createPost(status: PublicationStatus = PUBLISHED, data: PostInput!): Post
|
||||
updatePost(documentId: ID!, status: PublicationStatus = PUBLISHED, data: PostInput!): Post
|
||||
deletePost(documentId: ID!): DeleteMutationResponse
|
||||
createTag(status: PublicationStatus = PUBLISHED, data: TagInput!): Tag
|
||||
updateTag(documentId: ID!, status: PublicationStatus = PUBLISHED, data: TagInput!): Tag
|
||||
deleteTag(documentId: ID!): DeleteMutationResponse
|
||||
updateUploadFile(id: ID!, info: FileInfoInput): UploadFile!
|
||||
deleteUploadFile(id: ID!): UploadFile
|
||||
|
||||
"""Create a new role"""
|
||||
createUsersPermissionsRole(data: UsersPermissionsRoleInput!): UsersPermissionsCreateRolePayload
|
||||
|
||||
"""Update an existing role"""
|
||||
updateUsersPermissionsRole(id: ID!, data: UsersPermissionsRoleInput!): UsersPermissionsUpdateRolePayload
|
||||
|
||||
"""Delete an existing role"""
|
||||
deleteUsersPermissionsRole(id: ID!): UsersPermissionsDeleteRolePayload
|
||||
|
||||
"""Create a new user"""
|
||||
createUsersPermissionsUser(data: UsersPermissionsUserInput!): UsersPermissionsUserEntityResponse!
|
||||
|
||||
"""Update an existing user"""
|
||||
updateUsersPermissionsUser(id: ID!, data: UsersPermissionsUserInput!): UsersPermissionsUserEntityResponse!
|
||||
|
||||
"""Delete an existing user"""
|
||||
deleteUsersPermissionsUser(id: ID!): UsersPermissionsUserEntityResponse!
|
||||
login(input: UsersPermissionsLoginInput!): UsersPermissionsLoginPayload!
|
||||
|
||||
"""Register a user"""
|
||||
register(input: UsersPermissionsRegisterInput!): UsersPermissionsLoginPayload!
|
||||
|
||||
"""Request a reset password token"""
|
||||
forgotPassword(email: String!): UsersPermissionsPasswordPayload
|
||||
|
||||
"""
|
||||
Reset user password. Confirm with a code (resetToken from forgotPassword)
|
||||
"""
|
||||
resetPassword(password: String!, passwordConfirmation: String!, code: String!): UsersPermissionsLoginPayload
|
||||
|
||||
"""Change user password. Confirm with the current password."""
|
||||
changePassword(currentPassword: String!, password: String!, passwordConfirmation: String!): UsersPermissionsLoginPayload
|
||||
|
||||
"""Confirm an email users email address"""
|
||||
emailConfirmation(confirmation: String!): UsersPermissionsLoginPayload
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user