feat: added graphql queries
This commit is contained in:
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