9467 lines
264 KiB
Go
9467 lines
264 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package generated
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"strconv"
|
|
"sync"
|
|
"sync/atomic"
|
|
"time"
|
|
|
|
"gitea.dwysokinski.me/zdam-egzamin-zawodowy/backend/internal/model"
|
|
"github.com/99designs/gqlgen/graphql"
|
|
"github.com/99designs/gqlgen/graphql/introspection"
|
|
gqlparser "github.com/vektah/gqlparser/v2"
|
|
"github.com/vektah/gqlparser/v2/ast"
|
|
)
|
|
|
|
// region ************************** generated!.gotpl **************************
|
|
|
|
// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
|
|
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
|
|
return &executableSchema{
|
|
resolvers: cfg.Resolvers,
|
|
directives: cfg.Directives,
|
|
complexity: cfg.Complexity,
|
|
}
|
|
}
|
|
|
|
type Config struct {
|
|
Resolvers ResolverRoot
|
|
Directives DirectiveRoot
|
|
Complexity ComplexityRoot
|
|
}
|
|
|
|
type ResolverRoot interface {
|
|
Mutation() MutationResolver
|
|
Profession() ProfessionResolver
|
|
Query() QueryResolver
|
|
Question() QuestionResolver
|
|
}
|
|
|
|
type DirectiveRoot struct {
|
|
Authenticated func(ctx context.Context, obj interface{}, next graphql.Resolver, yes bool) (res interface{}, err error)
|
|
HasRole func(ctx context.Context, obj interface{}, next graphql.Resolver, role model.Role) (res interface{}, err error)
|
|
}
|
|
|
|
type ComplexityRoot struct {
|
|
Mutation struct {
|
|
CreateProfession func(childComplexity int, input model.ProfessionInput) int
|
|
CreateQualification func(childComplexity int, input model.QualificationInput) int
|
|
CreateQuestion func(childComplexity int, input model.QuestionInput) int
|
|
CreateUser func(childComplexity int, input model.UserInput) int
|
|
DeleteProfessions func(childComplexity int, ids []int) int
|
|
DeleteQualifications func(childComplexity int, ids []int) int
|
|
DeleteQuestions func(childComplexity int, ids []int) int
|
|
DeleteUsers func(childComplexity int, ids []int) int
|
|
SignIn func(childComplexity int, email string, password string, staySignedIn *bool) int
|
|
UpdateManyUsers func(childComplexity int, ids []int, input model.UserInput) int
|
|
UpdateProfession func(childComplexity int, id int, input model.ProfessionInput) int
|
|
UpdateQualification func(childComplexity int, id int, input model.QualificationInput) int
|
|
UpdateQuestion func(childComplexity int, id int, input model.QuestionInput) int
|
|
UpdateUser func(childComplexity int, id int, input model.UserInput) int
|
|
}
|
|
|
|
Profession struct {
|
|
CreatedAt func(childComplexity int) int
|
|
Description func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
Name func(childComplexity int) int
|
|
Qualifications func(childComplexity int) int
|
|
Slug func(childComplexity int) int
|
|
}
|
|
|
|
ProfessionList struct {
|
|
Items func(childComplexity int) int
|
|
Total func(childComplexity int) int
|
|
}
|
|
|
|
Qualification struct {
|
|
Code func(childComplexity int) int
|
|
CreatedAt func(childComplexity int) int
|
|
Description func(childComplexity int) int
|
|
Formula func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
Name func(childComplexity int) int
|
|
Slug func(childComplexity int) int
|
|
}
|
|
|
|
QualificationList struct {
|
|
Items func(childComplexity int) int
|
|
Total func(childComplexity int) int
|
|
}
|
|
|
|
Query struct {
|
|
GenerateTest func(childComplexity int, qualificationIDs []int, limit *int) int
|
|
Me func(childComplexity int) int
|
|
Profession func(childComplexity int, id *int, slug *string) int
|
|
Professions func(childComplexity int, filter *model.ProfessionFilter, limit *int, offset *int, sort []string) int
|
|
Qualification func(childComplexity int, id *int, slug *string) int
|
|
Qualifications func(childComplexity int, filter *model.QualificationFilter, limit *int, offset *int, sort []string) int
|
|
Questions func(childComplexity int, filter *model.QuestionFilter, limit *int, offset *int, sort []string) int
|
|
SimilarQualifications func(childComplexity int, qualificationID int, limit *int, offset *int, sort []string) int
|
|
User func(childComplexity int, id int) int
|
|
Users func(childComplexity int, filter *model.UserFilter, limit *int, offset *int, sort []string) int
|
|
}
|
|
|
|
Question struct {
|
|
AnswerA func(childComplexity int) int
|
|
AnswerAImage func(childComplexity int) int
|
|
AnswerB func(childComplexity int) int
|
|
AnswerBImage func(childComplexity int) int
|
|
AnswerC func(childComplexity int) int
|
|
AnswerCImage func(childComplexity int) int
|
|
AnswerD func(childComplexity int) int
|
|
AnswerDImage func(childComplexity int) int
|
|
Content func(childComplexity int) int
|
|
CorrectAnswer func(childComplexity int) int
|
|
CreatedAt func(childComplexity int) int
|
|
Explanation func(childComplexity int) int
|
|
From func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
Image func(childComplexity int) int
|
|
Qualification func(childComplexity int) int
|
|
UpdatedAt func(childComplexity int) int
|
|
}
|
|
|
|
QuestionList struct {
|
|
Items func(childComplexity int) int
|
|
Total func(childComplexity int) int
|
|
}
|
|
|
|
User struct {
|
|
Activated func(childComplexity int) int
|
|
CreatedAt func(childComplexity int) int
|
|
DisplayName func(childComplexity int) int
|
|
Email func(childComplexity int) int
|
|
ID func(childComplexity int) int
|
|
Role func(childComplexity int) int
|
|
}
|
|
|
|
UserList struct {
|
|
Items func(childComplexity int) int
|
|
Total func(childComplexity int) int
|
|
}
|
|
|
|
UserWithToken struct {
|
|
Token func(childComplexity int) int
|
|
User func(childComplexity int) int
|
|
}
|
|
}
|
|
|
|
type MutationResolver interface {
|
|
CreateProfession(ctx context.Context, input model.ProfessionInput) (*model.Profession, error)
|
|
UpdateProfession(ctx context.Context, id int, input model.ProfessionInput) (*model.Profession, error)
|
|
DeleteProfessions(ctx context.Context, ids []int) ([]*model.Profession, error)
|
|
CreateQualification(ctx context.Context, input model.QualificationInput) (*model.Qualification, error)
|
|
UpdateQualification(ctx context.Context, id int, input model.QualificationInput) (*model.Qualification, error)
|
|
DeleteQualifications(ctx context.Context, ids []int) ([]*model.Qualification, error)
|
|
CreateQuestion(ctx context.Context, input model.QuestionInput) (*model.Question, error)
|
|
UpdateQuestion(ctx context.Context, id int, input model.QuestionInput) (*model.Question, error)
|
|
DeleteQuestions(ctx context.Context, ids []int) ([]*model.Question, error)
|
|
CreateUser(ctx context.Context, input model.UserInput) (*model.User, error)
|
|
UpdateUser(ctx context.Context, id int, input model.UserInput) (*model.User, error)
|
|
UpdateManyUsers(ctx context.Context, ids []int, input model.UserInput) ([]*model.User, error)
|
|
DeleteUsers(ctx context.Context, ids []int) ([]*model.User, error)
|
|
SignIn(ctx context.Context, email string, password string, staySignedIn *bool) (*UserWithToken, error)
|
|
}
|
|
type ProfessionResolver interface {
|
|
Qualifications(ctx context.Context, obj *model.Profession) ([]*model.Qualification, error)
|
|
}
|
|
type QueryResolver interface {
|
|
Professions(ctx context.Context, filter *model.ProfessionFilter, limit *int, offset *int, sort []string) (*ProfessionList, error)
|
|
Profession(ctx context.Context, id *int, slug *string) (*model.Profession, error)
|
|
Qualifications(ctx context.Context, filter *model.QualificationFilter, limit *int, offset *int, sort []string) (*QualificationList, error)
|
|
SimilarQualifications(ctx context.Context, qualificationID int, limit *int, offset *int, sort []string) (*QualificationList, error)
|
|
Qualification(ctx context.Context, id *int, slug *string) (*model.Qualification, error)
|
|
Questions(ctx context.Context, filter *model.QuestionFilter, limit *int, offset *int, sort []string) (*QuestionList, error)
|
|
GenerateTest(ctx context.Context, qualificationIDs []int, limit *int) ([]*model.Question, error)
|
|
Users(ctx context.Context, filter *model.UserFilter, limit *int, offset *int, sort []string) (*UserList, error)
|
|
User(ctx context.Context, id int) (*model.User, error)
|
|
Me(ctx context.Context) (*model.User, error)
|
|
}
|
|
type QuestionResolver interface {
|
|
Qualification(ctx context.Context, obj *model.Question) (*model.Qualification, error)
|
|
}
|
|
|
|
type executableSchema struct {
|
|
resolvers ResolverRoot
|
|
directives DirectiveRoot
|
|
complexity ComplexityRoot
|
|
}
|
|
|
|
func (e *executableSchema) Schema() *ast.Schema {
|
|
return parsedSchema
|
|
}
|
|
|
|
func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
|
|
ec := executionContext{nil, e}
|
|
_ = ec
|
|
switch typeName + "." + field {
|
|
|
|
case "Mutation.createProfession":
|
|
if e.complexity.Mutation.CreateProfession == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_createProfession_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.CreateProfession(childComplexity, args["input"].(model.ProfessionInput)), true
|
|
|
|
case "Mutation.createQualification":
|
|
if e.complexity.Mutation.CreateQualification == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_createQualification_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.CreateQualification(childComplexity, args["input"].(model.QualificationInput)), true
|
|
|
|
case "Mutation.createQuestion":
|
|
if e.complexity.Mutation.CreateQuestion == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_createQuestion_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.CreateQuestion(childComplexity, args["input"].(model.QuestionInput)), true
|
|
|
|
case "Mutation.createUser":
|
|
if e.complexity.Mutation.CreateUser == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_createUser_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.CreateUser(childComplexity, args["input"].(model.UserInput)), true
|
|
|
|
case "Mutation.deleteProfessions":
|
|
if e.complexity.Mutation.DeleteProfessions == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_deleteProfessions_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.DeleteProfessions(childComplexity, args["ids"].([]int)), true
|
|
|
|
case "Mutation.deleteQualifications":
|
|
if e.complexity.Mutation.DeleteQualifications == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_deleteQualifications_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.DeleteQualifications(childComplexity, args["ids"].([]int)), true
|
|
|
|
case "Mutation.deleteQuestions":
|
|
if e.complexity.Mutation.DeleteQuestions == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_deleteQuestions_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.DeleteQuestions(childComplexity, args["ids"].([]int)), true
|
|
|
|
case "Mutation.deleteUsers":
|
|
if e.complexity.Mutation.DeleteUsers == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_deleteUsers_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.DeleteUsers(childComplexity, args["ids"].([]int)), true
|
|
|
|
case "Mutation.signIn":
|
|
if e.complexity.Mutation.SignIn == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_signIn_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.SignIn(childComplexity, args["email"].(string), args["password"].(string), args["staySignedIn"].(*bool)), true
|
|
|
|
case "Mutation.updateManyUsers":
|
|
if e.complexity.Mutation.UpdateManyUsers == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_updateManyUsers_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UpdateManyUsers(childComplexity, args["ids"].([]int), args["input"].(model.UserInput)), true
|
|
|
|
case "Mutation.updateProfession":
|
|
if e.complexity.Mutation.UpdateProfession == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_updateProfession_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UpdateProfession(childComplexity, args["id"].(int), args["input"].(model.ProfessionInput)), true
|
|
|
|
case "Mutation.updateQualification":
|
|
if e.complexity.Mutation.UpdateQualification == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_updateQualification_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UpdateQualification(childComplexity, args["id"].(int), args["input"].(model.QualificationInput)), true
|
|
|
|
case "Mutation.updateQuestion":
|
|
if e.complexity.Mutation.UpdateQuestion == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_updateQuestion_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UpdateQuestion(childComplexity, args["id"].(int), args["input"].(model.QuestionInput)), true
|
|
|
|
case "Mutation.updateUser":
|
|
if e.complexity.Mutation.UpdateUser == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Mutation_updateUser_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UpdateUser(childComplexity, args["id"].(int), args["input"].(model.UserInput)), true
|
|
|
|
case "Profession.createdAt":
|
|
if e.complexity.Profession.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Profession.CreatedAt(childComplexity), true
|
|
|
|
case "Profession.description":
|
|
if e.complexity.Profession.Description == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Profession.Description(childComplexity), true
|
|
|
|
case "Profession.id":
|
|
if e.complexity.Profession.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Profession.ID(childComplexity), true
|
|
|
|
case "Profession.name":
|
|
if e.complexity.Profession.Name == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Profession.Name(childComplexity), true
|
|
|
|
case "Profession.qualifications":
|
|
if e.complexity.Profession.Qualifications == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Profession.Qualifications(childComplexity), true
|
|
|
|
case "Profession.slug":
|
|
if e.complexity.Profession.Slug == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Profession.Slug(childComplexity), true
|
|
|
|
case "ProfessionList.items":
|
|
if e.complexity.ProfessionList.Items == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ProfessionList.Items(childComplexity), true
|
|
|
|
case "ProfessionList.total":
|
|
if e.complexity.ProfessionList.Total == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ProfessionList.Total(childComplexity), true
|
|
|
|
case "Qualification.code":
|
|
if e.complexity.Qualification.Code == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Qualification.Code(childComplexity), true
|
|
|
|
case "Qualification.createdAt":
|
|
if e.complexity.Qualification.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Qualification.CreatedAt(childComplexity), true
|
|
|
|
case "Qualification.description":
|
|
if e.complexity.Qualification.Description == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Qualification.Description(childComplexity), true
|
|
|
|
case "Qualification.formula":
|
|
if e.complexity.Qualification.Formula == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Qualification.Formula(childComplexity), true
|
|
|
|
case "Qualification.id":
|
|
if e.complexity.Qualification.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Qualification.ID(childComplexity), true
|
|
|
|
case "Qualification.name":
|
|
if e.complexity.Qualification.Name == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Qualification.Name(childComplexity), true
|
|
|
|
case "Qualification.slug":
|
|
if e.complexity.Qualification.Slug == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Qualification.Slug(childComplexity), true
|
|
|
|
case "QualificationList.items":
|
|
if e.complexity.QualificationList.Items == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QualificationList.Items(childComplexity), true
|
|
|
|
case "QualificationList.total":
|
|
if e.complexity.QualificationList.Total == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QualificationList.Total(childComplexity), true
|
|
|
|
case "Query.generateTest":
|
|
if e.complexity.Query.GenerateTest == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_generateTest_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.GenerateTest(childComplexity, args["qualificationIDs"].([]int), args["limit"].(*int)), true
|
|
|
|
case "Query.me":
|
|
if e.complexity.Query.Me == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Query.Me(childComplexity), true
|
|
|
|
case "Query.profession":
|
|
if e.complexity.Query.Profession == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_profession_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.Profession(childComplexity, args["id"].(*int), args["slug"].(*string)), true
|
|
|
|
case "Query.professions":
|
|
if e.complexity.Query.Professions == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_professions_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.Professions(childComplexity, args["filter"].(*model.ProfessionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true
|
|
|
|
case "Query.qualification":
|
|
if e.complexity.Query.Qualification == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_qualification_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.Qualification(childComplexity, args["id"].(*int), args["slug"].(*string)), true
|
|
|
|
case "Query.qualifications":
|
|
if e.complexity.Query.Qualifications == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_qualifications_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.Qualifications(childComplexity, args["filter"].(*model.QualificationFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true
|
|
|
|
case "Query.questions":
|
|
if e.complexity.Query.Questions == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_questions_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.Questions(childComplexity, args["filter"].(*model.QuestionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true
|
|
|
|
case "Query.similarQualifications":
|
|
if e.complexity.Query.SimilarQualifications == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_similarQualifications_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.SimilarQualifications(childComplexity, args["qualificationID"].(int), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true
|
|
|
|
case "Query.user":
|
|
if e.complexity.Query.User == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_user_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.User(childComplexity, args["id"].(int)), true
|
|
|
|
case "Query.users":
|
|
if e.complexity.Query.Users == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_users_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.Users(childComplexity, args["filter"].(*model.UserFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string)), true
|
|
|
|
case "Question.answerA":
|
|
if e.complexity.Question.AnswerA == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerA(childComplexity), true
|
|
|
|
case "Question.answerAImage":
|
|
if e.complexity.Question.AnswerAImage == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerAImage(childComplexity), true
|
|
|
|
case "Question.answerB":
|
|
if e.complexity.Question.AnswerB == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerB(childComplexity), true
|
|
|
|
case "Question.answerBImage":
|
|
if e.complexity.Question.AnswerBImage == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerBImage(childComplexity), true
|
|
|
|
case "Question.answerC":
|
|
if e.complexity.Question.AnswerC == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerC(childComplexity), true
|
|
|
|
case "Question.answerCImage":
|
|
if e.complexity.Question.AnswerCImage == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerCImage(childComplexity), true
|
|
|
|
case "Question.answerD":
|
|
if e.complexity.Question.AnswerD == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerD(childComplexity), true
|
|
|
|
case "Question.answerDImage":
|
|
if e.complexity.Question.AnswerDImage == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.AnswerDImage(childComplexity), true
|
|
|
|
case "Question.content":
|
|
if e.complexity.Question.Content == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.Content(childComplexity), true
|
|
|
|
case "Question.correctAnswer":
|
|
if e.complexity.Question.CorrectAnswer == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.CorrectAnswer(childComplexity), true
|
|
|
|
case "Question.createdAt":
|
|
if e.complexity.Question.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.CreatedAt(childComplexity), true
|
|
|
|
case "Question.explanation":
|
|
if e.complexity.Question.Explanation == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.Explanation(childComplexity), true
|
|
|
|
case "Question.from":
|
|
if e.complexity.Question.From == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.From(childComplexity), true
|
|
|
|
case "Question.id":
|
|
if e.complexity.Question.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.ID(childComplexity), true
|
|
|
|
case "Question.image":
|
|
if e.complexity.Question.Image == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.Image(childComplexity), true
|
|
|
|
case "Question.qualification":
|
|
if e.complexity.Question.Qualification == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.Qualification(childComplexity), true
|
|
|
|
case "Question.updatedAt":
|
|
if e.complexity.Question.UpdatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Question.UpdatedAt(childComplexity), true
|
|
|
|
case "QuestionList.items":
|
|
if e.complexity.QuestionList.Items == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QuestionList.Items(childComplexity), true
|
|
|
|
case "QuestionList.total":
|
|
if e.complexity.QuestionList.Total == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QuestionList.Total(childComplexity), true
|
|
|
|
case "User.activated":
|
|
if e.complexity.User.Activated == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.Activated(childComplexity), true
|
|
|
|
case "User.createdAt":
|
|
if e.complexity.User.CreatedAt == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.CreatedAt(childComplexity), true
|
|
|
|
case "User.displayName":
|
|
if e.complexity.User.DisplayName == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.DisplayName(childComplexity), true
|
|
|
|
case "User.email":
|
|
if e.complexity.User.Email == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.Email(childComplexity), true
|
|
|
|
case "User.id":
|
|
if e.complexity.User.ID == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.ID(childComplexity), true
|
|
|
|
case "User.role":
|
|
if e.complexity.User.Role == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.User.Role(childComplexity), true
|
|
|
|
case "UserList.items":
|
|
if e.complexity.UserList.Items == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.UserList.Items(childComplexity), true
|
|
|
|
case "UserList.total":
|
|
if e.complexity.UserList.Total == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.UserList.Total(childComplexity), true
|
|
|
|
case "UserWithToken.token":
|
|
if e.complexity.UserWithToken.Token == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.UserWithToken.Token(childComplexity), true
|
|
|
|
case "UserWithToken.user":
|
|
if e.complexity.UserWithToken.User == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.UserWithToken.User(childComplexity), true
|
|
|
|
}
|
|
return 0, false
|
|
}
|
|
|
|
func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
|
|
rc := graphql.GetOperationContext(ctx)
|
|
ec := executionContext{rc, e}
|
|
first := true
|
|
|
|
switch rc.Operation.Operation {
|
|
case ast.Query:
|
|
return func(ctx context.Context) *graphql.Response {
|
|
if !first {
|
|
return nil
|
|
}
|
|
first = false
|
|
data := ec._Query(ctx, rc.Operation.SelectionSet)
|
|
var buf bytes.Buffer
|
|
data.MarshalGQL(&buf)
|
|
|
|
return &graphql.Response{
|
|
Data: buf.Bytes(),
|
|
}
|
|
}
|
|
case ast.Mutation:
|
|
return func(ctx context.Context) *graphql.Response {
|
|
if !first {
|
|
return nil
|
|
}
|
|
first = false
|
|
data := ec._Mutation(ctx, rc.Operation.SelectionSet)
|
|
var buf bytes.Buffer
|
|
data.MarshalGQL(&buf)
|
|
|
|
return &graphql.Response{
|
|
Data: buf.Bytes(),
|
|
}
|
|
}
|
|
|
|
default:
|
|
return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
|
|
}
|
|
}
|
|
|
|
type executionContext struct {
|
|
*graphql.OperationContext
|
|
*executableSchema
|
|
}
|
|
|
|
func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
|
|
if ec.DisableIntrospection {
|
|
return nil, errors.New("introspection disabled")
|
|
}
|
|
return introspection.WrapSchema(parsedSchema), nil
|
|
}
|
|
|
|
func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
|
|
if ec.DisableIntrospection {
|
|
return nil, errors.New("introspection disabled")
|
|
}
|
|
return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil
|
|
}
|
|
|
|
var sources = []*ast.Source{
|
|
{Name: "schema/directives.graphql", Input: `directive @goField(
|
|
forceResolver: Boolean
|
|
name: String
|
|
) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION
|
|
|
|
directive @authenticated(yes: Boolean!) on FIELD_DEFINITION
|
|
directive @hasRole(role: Role!) on FIELD_DEFINITION
|
|
`, BuiltIn: false},
|
|
{Name: "schema/profession.graphql", Input: `type Profession {
|
|
id: ID!
|
|
slug: String!
|
|
name: String!
|
|
description: String
|
|
createdAt: Time!
|
|
qualifications: [Qualification!]! @goField(forceResolver: true)
|
|
}
|
|
|
|
type ProfessionList {
|
|
total: Int!
|
|
items: [Profession!]
|
|
}
|
|
|
|
input ProfessionInput {
|
|
name: String
|
|
description: String
|
|
}
|
|
|
|
input ProfessionFilter {
|
|
id: [ID!]
|
|
idNEQ: [ID!]
|
|
|
|
slug: [String!]
|
|
slugNEQ: [String!]
|
|
|
|
name: [String!]
|
|
nameNEQ: [String!]
|
|
nameIEQ: String
|
|
nameMATCH: String
|
|
|
|
descriptionIEQ: String
|
|
descriptionMATCH: String
|
|
|
|
qualificationID: [ID!]
|
|
|
|
createdAt: Time
|
|
createdAtGT: Time
|
|
createdAtGTE: Time
|
|
createdAtLT: Time
|
|
createdAtLTE: Time
|
|
}
|
|
|
|
extend type Query {
|
|
professions(
|
|
filter: ProfessionFilter
|
|
limit: Int
|
|
offset: Int
|
|
sort: [String!]
|
|
): ProfessionList!
|
|
profession(id: ID, slug: String): Profession
|
|
}
|
|
|
|
extend type Mutation {
|
|
createProfession(input: ProfessionInput!): Profession
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
updateProfession(id: ID!, input: ProfessionInput!): Profession
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
deleteProfessions(ids: [ID!]!): [Profession!]
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "schema/qualification.graphql", Input: `type Qualification {
|
|
id: ID!
|
|
slug: String!
|
|
name: String!
|
|
code: String!
|
|
formula: String
|
|
description: String
|
|
createdAt: Time!
|
|
}
|
|
|
|
type QualificationList {
|
|
total: Int!
|
|
items: [Qualification!]
|
|
}
|
|
|
|
input QualificationInput {
|
|
name: String
|
|
description: String
|
|
code: String
|
|
formula: String
|
|
associateProfession: [Int!]
|
|
dissociateProfession: [Int!]
|
|
}
|
|
|
|
input QualificationFilterOr {
|
|
nameMatch: String
|
|
nameIEQ: String
|
|
|
|
codeMatch: String
|
|
codeIEQ: String
|
|
}
|
|
|
|
input QualificationFilter {
|
|
id: [ID!]
|
|
idNEQ: [ID!]
|
|
|
|
slug: [String!]
|
|
slugNEQ: [String!]
|
|
|
|
formula: [String!]
|
|
formulaNEQ: [String!]
|
|
|
|
name: [String!]
|
|
nameNEQ: [String!]
|
|
nameIEQ: String
|
|
nameMATCH: String
|
|
|
|
code: [String!]
|
|
codeNEQ: [String!]
|
|
codeIEQ: String
|
|
codeMATCH: String
|
|
|
|
descriptionIEQ: String
|
|
descriptionMATCH: String
|
|
|
|
professionID: [Int!]
|
|
|
|
createdAt: Time
|
|
createdAtGT: Time
|
|
createdAtGTE: Time
|
|
createdAtLT: Time
|
|
createdAtLTE: Time
|
|
|
|
or: QualificationFilterOr
|
|
}
|
|
|
|
extend type Query {
|
|
qualifications(
|
|
filter: QualificationFilter
|
|
limit: Int
|
|
offset: Int
|
|
sort: [String!]
|
|
): QualificationList!
|
|
similarQualifications(
|
|
qualificationID: ID!
|
|
limit: Int
|
|
offset: Int
|
|
sort: [String!]
|
|
): QualificationList!
|
|
qualification(id: ID, slug: String): Qualification
|
|
}
|
|
|
|
extend type Mutation {
|
|
createQualification(input: QualificationInput!): Qualification
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
updateQualification(id: ID!, input: QualificationInput!): Qualification
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
deleteQualifications(ids: [ID!]!): [Qualification!]
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "schema/question.graphql", Input: `enum Answer {
|
|
a
|
|
b
|
|
c
|
|
d
|
|
}
|
|
|
|
type Question {
|
|
id: ID!
|
|
from: String
|
|
content: String!
|
|
explanation: String
|
|
correctAnswer: Answer!
|
|
image: String
|
|
answerA: String
|
|
answerAImage: String
|
|
answerB: String
|
|
answerBImage: String
|
|
answerC: String
|
|
answerCImage: String
|
|
answerD: String
|
|
answerDImage: String
|
|
qualification: Qualification @goField(forceResolver: true)
|
|
createdAt: Time!
|
|
updatedAt: Time!
|
|
}
|
|
|
|
type QuestionList {
|
|
total: Int!
|
|
items: [Question!]
|
|
}
|
|
|
|
input QuestionInput {
|
|
content: String
|
|
from: String
|
|
explanation: String
|
|
correctAnswer: Answer
|
|
qualificationID: Int
|
|
image: Upload
|
|
deleteImage: Boolean
|
|
answerA: String
|
|
answerAImage: Upload
|
|
deleteAnswerAImage: Boolean
|
|
answerB: String
|
|
answerBImage: Upload
|
|
deleteAnswerBImage: Boolean
|
|
answerC: String
|
|
answerCImage: Upload
|
|
deleteAnswerCImage: Boolean
|
|
answerD: String
|
|
answerDImage: Upload
|
|
deleteAnswerDImage: Boolean
|
|
}
|
|
|
|
input QuestionFilter {
|
|
id: [ID!]
|
|
idNEQ: [ID!]
|
|
|
|
from: [String!]
|
|
|
|
contentIEQ: String
|
|
contentMATCH: String
|
|
|
|
qualificationID: [Int!]
|
|
qualificationIDNEQ: [Int!]
|
|
qualificationFilter: QualificationFilter
|
|
|
|
createdAt: Time
|
|
createdAtGT: Time
|
|
createdAtGTE: Time
|
|
createdAtLT: Time
|
|
createdAtLTE: Time
|
|
}
|
|
|
|
extend type Query {
|
|
questions(
|
|
filter: QuestionFilter
|
|
limit: Int
|
|
offset: Int
|
|
sort: [String!]
|
|
): QuestionList! @authenticated(yes: true) @hasRole(role: admin)
|
|
generateTest(qualificationIDs: [ID!]!, limit: Int): [Question!]
|
|
}
|
|
|
|
extend type Mutation {
|
|
createQuestion(input: QuestionInput!): Question
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
updateQuestion(id: ID!, input: QuestionInput!): Question
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
deleteQuestions(ids: [ID!]!): [Question!]
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "schema/scalars.graphql", Input: `scalar Time
|
|
scalar Upload
|
|
`, BuiltIn: false},
|
|
{Name: "schema/user.graphql", Input: `enum Role {
|
|
admin
|
|
user
|
|
}
|
|
|
|
type User {
|
|
id: ID!
|
|
displayName: String!
|
|
role: Role!
|
|
email: String!
|
|
activated: Boolean!
|
|
createdAt: Time!
|
|
}
|
|
|
|
type UserList {
|
|
total: Int!
|
|
items: [User!]
|
|
}
|
|
|
|
input UserInput {
|
|
displayName: String
|
|
password: String
|
|
email: String
|
|
role: Role
|
|
activated: Boolean
|
|
}
|
|
|
|
input UpdateManyUsersInput {
|
|
role: Role
|
|
activated: Boolean
|
|
}
|
|
|
|
input UserFilterOr {
|
|
displayNameIEQ: String
|
|
displayNameMATCH: String
|
|
|
|
emailIEQ: String
|
|
emailMATCH: String
|
|
}
|
|
|
|
input UserFilter {
|
|
id: [ID!]
|
|
idNEQ: [ID!]
|
|
|
|
activated: Boolean
|
|
|
|
displayName: [String!]
|
|
displayNameNEQ: [String!]
|
|
displayNameIEQ: String
|
|
displayNameMATCH: String
|
|
|
|
email: [String!]
|
|
emailNEQ: [String!]
|
|
emailIEQ: String
|
|
emailMATCH: String
|
|
|
|
role: [Role!]
|
|
roleNEQ: [Role!]
|
|
|
|
createdAt: Time
|
|
createdAtGT: Time
|
|
createdAtGTE: Time
|
|
createdAtLT: Time
|
|
createdAtLTE: Time
|
|
|
|
or: UserFilterOr
|
|
}
|
|
|
|
type UserWithToken {
|
|
token: String!
|
|
user: User!
|
|
}
|
|
|
|
extend type Query {
|
|
users(
|
|
filter: UserFilter
|
|
limit: Int
|
|
offset: Int
|
|
sort: [String!]
|
|
): UserList! @authenticated(yes: true) @hasRole(role: Admin)
|
|
user(id: ID!): User @authenticated(yes: true) @hasRole(role: Admin)
|
|
me: User
|
|
}
|
|
|
|
extend type Mutation {
|
|
createUser(input: UserInput!): User
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
updateUser(id: ID!, input: UserInput!): User
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
updateManyUsers(ids: [ID!]!, input: UpdateManyUsersInput!): [User!]
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
deleteUsers(ids: [ID!]!): [User!]
|
|
@authenticated(yes: true)
|
|
@hasRole(role: admin)
|
|
signIn(
|
|
email: String!
|
|
password: String!
|
|
staySignedIn: Boolean
|
|
): UserWithToken @authenticated(yes: false)
|
|
}
|
|
`, BuiltIn: false},
|
|
}
|
|
var parsedSchema = gqlparser.MustLoadSchema(sources...)
|
|
|
|
// endregion ************************** generated!.gotpl **************************
|
|
|
|
// region ***************************** args.gotpl *****************************
|
|
|
|
func (ec *executionContext) dir_authenticated_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 bool
|
|
if tmp, ok := rawArgs["yes"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("yes"))
|
|
arg0, err = ec.unmarshalNBoolean2bool(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["yes"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) dir_hasRole_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 model.Role
|
|
if tmp, ok := rawArgs["role"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role"))
|
|
arg0, err = ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["role"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createProfession_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 model.ProfessionInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg0, err = ec.unmarshalNProfessionInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createQualification_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 model.QualificationInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg0, err = ec.unmarshalNQualificationInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createQuestion_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 model.QuestionInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg0, err = ec.unmarshalNQuestionInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_createUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 model.UserInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg0, err = ec.unmarshalNUserInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_deleteProfessions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 []int
|
|
if tmp, ok := rawArgs["ids"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids"))
|
|
arg0, err = ec.unmarshalNID2ᚕintᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["ids"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_deleteQualifications_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 []int
|
|
if tmp, ok := rawArgs["ids"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids"))
|
|
arg0, err = ec.unmarshalNID2ᚕintᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["ids"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_deleteQuestions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 []int
|
|
if tmp, ok := rawArgs["ids"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids"))
|
|
arg0, err = ec.unmarshalNID2ᚕintᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["ids"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_deleteUsers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 []int
|
|
if tmp, ok := rawArgs["ids"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids"))
|
|
arg0, err = ec.unmarshalNID2ᚕintᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["ids"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_signIn_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 string
|
|
if tmp, ok := rawArgs["email"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
|
|
arg0, err = ec.unmarshalNString2string(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["email"] = arg0
|
|
var arg1 string
|
|
if tmp, ok := rawArgs["password"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password"))
|
|
arg1, err = ec.unmarshalNString2string(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["password"] = arg1
|
|
var arg2 *bool
|
|
if tmp, ok := rawArgs["staySignedIn"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("staySignedIn"))
|
|
arg2, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["staySignedIn"] = arg2
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_updateManyUsers_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 []int
|
|
if tmp, ok := rawArgs["ids"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids"))
|
|
arg0, err = ec.unmarshalNID2ᚕintᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["ids"] = arg0
|
|
var arg1 model.UserInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg1, err = ec.unmarshalNUpdateManyUsersInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_updateProfession_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 int
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
arg0, err = ec.unmarshalNID2int(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["id"] = arg0
|
|
var arg1 model.ProfessionInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg1, err = ec.unmarshalNProfessionInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_updateQualification_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 int
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
arg0, err = ec.unmarshalNID2int(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["id"] = arg0
|
|
var arg1 model.QualificationInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg1, err = ec.unmarshalNQualificationInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_updateQuestion_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 int
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
arg0, err = ec.unmarshalNID2int(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["id"] = arg0
|
|
var arg1 model.QuestionInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg1, err = ec.unmarshalNQuestionInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_updateUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 int
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
arg0, err = ec.unmarshalNID2int(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["id"] = arg0
|
|
var arg1 model.UserInput
|
|
if tmp, ok := rawArgs["input"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
|
|
arg1, err = ec.unmarshalNUserInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserInput(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["input"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 string
|
|
if tmp, ok := rawArgs["name"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
arg0, err = ec.unmarshalNString2string(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["name"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_generateTest_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 []int
|
|
if tmp, ok := rawArgs["qualificationIDs"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("qualificationIDs"))
|
|
arg0, err = ec.unmarshalNID2ᚕintᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["qualificationIDs"] = arg0
|
|
var arg1 *int
|
|
if tmp, ok := rawArgs["limit"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
|
|
arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["limit"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_profession_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 *int
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
arg0, err = ec.unmarshalOID2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["id"] = arg0
|
|
var arg1 *string
|
|
if tmp, ok := rawArgs["slug"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slug"))
|
|
arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["slug"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_professions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 *model.ProfessionFilter
|
|
if tmp, ok := rawArgs["filter"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter"))
|
|
arg0, err = ec.unmarshalOProfessionFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionFilter(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["filter"] = arg0
|
|
var arg1 *int
|
|
if tmp, ok := rawArgs["limit"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
|
|
arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["limit"] = arg1
|
|
var arg2 *int
|
|
if tmp, ok := rawArgs["offset"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offset"))
|
|
arg2, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["offset"] = arg2
|
|
var arg3 []string
|
|
if tmp, ok := rawArgs["sort"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sort"))
|
|
arg3, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["sort"] = arg3
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_qualification_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 *int
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
arg0, err = ec.unmarshalOID2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["id"] = arg0
|
|
var arg1 *string
|
|
if tmp, ok := rawArgs["slug"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slug"))
|
|
arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["slug"] = arg1
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_qualifications_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 *model.QualificationFilter
|
|
if tmp, ok := rawArgs["filter"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter"))
|
|
arg0, err = ec.unmarshalOQualificationFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationFilter(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["filter"] = arg0
|
|
var arg1 *int
|
|
if tmp, ok := rawArgs["limit"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
|
|
arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["limit"] = arg1
|
|
var arg2 *int
|
|
if tmp, ok := rawArgs["offset"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offset"))
|
|
arg2, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["offset"] = arg2
|
|
var arg3 []string
|
|
if tmp, ok := rawArgs["sort"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sort"))
|
|
arg3, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["sort"] = arg3
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_questions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 *model.QuestionFilter
|
|
if tmp, ok := rawArgs["filter"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter"))
|
|
arg0, err = ec.unmarshalOQuestionFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionFilter(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["filter"] = arg0
|
|
var arg1 *int
|
|
if tmp, ok := rawArgs["limit"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
|
|
arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["limit"] = arg1
|
|
var arg2 *int
|
|
if tmp, ok := rawArgs["offset"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offset"))
|
|
arg2, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["offset"] = arg2
|
|
var arg3 []string
|
|
if tmp, ok := rawArgs["sort"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sort"))
|
|
arg3, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["sort"] = arg3
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_similarQualifications_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 int
|
|
if tmp, ok := rawArgs["qualificationID"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("qualificationID"))
|
|
arg0, err = ec.unmarshalNID2int(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["qualificationID"] = arg0
|
|
var arg1 *int
|
|
if tmp, ok := rawArgs["limit"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
|
|
arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["limit"] = arg1
|
|
var arg2 *int
|
|
if tmp, ok := rawArgs["offset"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offset"))
|
|
arg2, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["offset"] = arg2
|
|
var arg3 []string
|
|
if tmp, ok := rawArgs["sort"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sort"))
|
|
arg3, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["sort"] = arg3
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 int
|
|
if tmp, ok := rawArgs["id"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
arg0, err = ec.unmarshalNID2int(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["id"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_users_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 *model.UserFilter
|
|
if tmp, ok := rawArgs["filter"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter"))
|
|
arg0, err = ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserFilter(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["filter"] = arg0
|
|
var arg1 *int
|
|
if tmp, ok := rawArgs["limit"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
|
|
arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["limit"] = arg1
|
|
var arg2 *int
|
|
if tmp, ok := rawArgs["offset"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offset"))
|
|
arg2, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["offset"] = arg2
|
|
var arg3 []string
|
|
if tmp, ok := rawArgs["sort"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sort"))
|
|
arg3, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["sort"] = arg3
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 bool
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
var arg0 bool
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
|
|
// endregion ***************************** args.gotpl *****************************
|
|
|
|
// region ************************** directives.gotpl **************************
|
|
|
|
// endregion ************************** directives.gotpl **************************
|
|
|
|
// region **************************** field.gotpl *****************************
|
|
|
|
func (ec *executionContext) _Mutation_createProfession(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_createProfession_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().CreateProfession(rctx, args["input"].(model.ProfessionInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.Profession); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.Profession`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Profession)
|
|
fc.Result = res
|
|
return ec.marshalOProfession2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfession(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_updateProfession(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_updateProfession_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().UpdateProfession(rctx, args["id"].(int), args["input"].(model.ProfessionInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.Profession); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.Profession`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Profession)
|
|
fc.Result = res
|
|
return ec.marshalOProfession2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfession(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_deleteProfessions(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_deleteProfessions_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().DeleteProfessions(rctx, args["ids"].([]int))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.([]*model.Profession); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/zdam-egzamin-zawodowy/backend/internal/model.Profession`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Profession)
|
|
fc.Result = res
|
|
return ec.marshalOProfession2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_createQualification(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_createQualification_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().CreateQualification(rctx, args["input"].(model.QualificationInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.Qualification); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.Qualification`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Qualification)
|
|
fc.Result = res
|
|
return ec.marshalOQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_updateQualification(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_updateQualification_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().UpdateQualification(rctx, args["id"].(int), args["input"].(model.QualificationInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.Qualification); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.Qualification`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Qualification)
|
|
fc.Result = res
|
|
return ec.marshalOQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_deleteQualifications(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_deleteQualifications_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().DeleteQualifications(rctx, args["ids"].([]int))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.([]*model.Qualification); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/zdam-egzamin-zawodowy/backend/internal/model.Qualification`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Qualification)
|
|
fc.Result = res
|
|
return ec.marshalOQualification2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_createQuestion(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_createQuestion_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().CreateQuestion(rctx, args["input"].(model.QuestionInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.Question); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.Question`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Question)
|
|
fc.Result = res
|
|
return ec.marshalOQuestion2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestion(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_updateQuestion(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_updateQuestion_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().UpdateQuestion(rctx, args["id"].(int), args["input"].(model.QuestionInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.Question); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.Question`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Question)
|
|
fc.Result = res
|
|
return ec.marshalOQuestion2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestion(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_deleteQuestions(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_deleteQuestions_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().DeleteQuestions(rctx, args["ids"].([]int))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.([]*model.Question); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/zdam-egzamin-zawodowy/backend/internal/model.Question`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Question)
|
|
fc.Result = res
|
|
return ec.marshalOQuestion2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_createUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_createUser_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().CreateUser(rctx, args["input"].(model.UserInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.User); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.User`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.User)
|
|
fc.Result = res
|
|
return ec.marshalOUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_updateUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_updateUser_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().UpdateUser(rctx, args["id"].(int), args["input"].(model.UserInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.User); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.User`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.User)
|
|
fc.Result = res
|
|
return ec.marshalOUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_updateManyUsers(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_updateManyUsers_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().UpdateManyUsers(rctx, args["ids"].([]int), args["input"].(model.UserInput))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.([]*model.User); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/zdam-egzamin-zawodowy/backend/internal/model.User`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.User)
|
|
fc.Result = res
|
|
return ec.marshalOUser2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_deleteUsers(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_deleteUsers_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().DeleteUsers(rctx, args["ids"].([]int))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.([]*model.User); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/zdam-egzamin-zawodowy/backend/internal/model.User`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.User)
|
|
fc.Result = res
|
|
return ec.marshalOUser2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_signIn(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Mutation_signIn_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Mutation().SignIn(rctx, args["email"].(string), args["password"].(string), args["staySignedIn"].(*bool))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, false)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
|
|
tmp, err := directive1(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*UserWithToken); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/graphql/generated.UserWithToken`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*UserWithToken)
|
|
fc.Result = res
|
|
return ec.marshalOUserWithToken2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐUserWithToken(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Profession_id(ctx context.Context, field graphql.CollectedField, obj *model.Profession) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Profession",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Profession_slug(ctx context.Context, field graphql.CollectedField, obj *model.Profession) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Profession",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Slug, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Profession_name(ctx context.Context, field graphql.CollectedField, obj *model.Profession) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Profession",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Profession_description(ctx context.Context, field graphql.CollectedField, obj *model.Profession) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Profession",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Profession_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.Profession) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Profession",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CreatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Profession_qualifications(ctx context.Context, field graphql.CollectedField, obj *model.Profession) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Profession",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Profession().Qualifications(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Qualification)
|
|
fc.Result = res
|
|
return ec.marshalNQualification2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _ProfessionList_total(ctx context.Context, field graphql.CollectedField, obj *ProfessionList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "ProfessionList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Total, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _ProfessionList_items(ctx context.Context, field graphql.CollectedField, obj *ProfessionList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "ProfessionList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Items, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Profession)
|
|
fc.Result = res
|
|
return ec.marshalOProfession2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Qualification_id(ctx context.Context, field graphql.CollectedField, obj *model.Qualification) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Qualification",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Qualification_slug(ctx context.Context, field graphql.CollectedField, obj *model.Qualification) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Qualification",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Slug, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Qualification_name(ctx context.Context, field graphql.CollectedField, obj *model.Qualification) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Qualification",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Qualification_code(ctx context.Context, field graphql.CollectedField, obj *model.Qualification) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Qualification",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Code, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Qualification_formula(ctx context.Context, field graphql.CollectedField, obj *model.Qualification) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Qualification",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Formula, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Qualification_description(ctx context.Context, field graphql.CollectedField, obj *model.Qualification) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Qualification",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Qualification_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.Qualification) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Qualification",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CreatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _QualificationList_total(ctx context.Context, field graphql.CollectedField, obj *QualificationList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "QualificationList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Total, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _QualificationList_items(ctx context.Context, field graphql.CollectedField, obj *QualificationList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "QualificationList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Items, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Qualification)
|
|
fc.Result = res
|
|
return ec.marshalOQualification2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_professions(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_professions_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Professions(rctx, args["filter"].(*model.ProfessionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*ProfessionList)
|
|
fc.Result = res
|
|
return ec.marshalNProfessionList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐProfessionList(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_profession(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_profession_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Profession(rctx, args["id"].(*int), args["slug"].(*string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Profession)
|
|
fc.Result = res
|
|
return ec.marshalOProfession2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfession(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_qualifications(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_qualifications_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Qualifications(rctx, args["filter"].(*model.QualificationFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*QualificationList)
|
|
fc.Result = res
|
|
return ec.marshalNQualificationList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐQualificationList(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_similarQualifications(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_similarQualifications_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().SimilarQualifications(rctx, args["qualificationID"].(int), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*QualificationList)
|
|
fc.Result = res
|
|
return ec.marshalNQualificationList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐQualificationList(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_qualification(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_qualification_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Qualification(rctx, args["id"].(*int), args["slug"].(*string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Qualification)
|
|
fc.Result = res
|
|
return ec.marshalOQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_questions(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_questions_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Questions(rctx, args["filter"].(*model.QuestionFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*QuestionList); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/graphql/generated.QuestionList`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*QuestionList)
|
|
fc.Result = res
|
|
return ec.marshalNQuestionList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐQuestionList(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_generateTest(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_generateTest_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().GenerateTest(rctx, args["qualificationIDs"].([]int), args["limit"].(*int))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Question)
|
|
fc.Result = res
|
|
return ec.marshalOQuestion2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_users_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Users(rctx, args["filter"].(*model.UserFilter), args["limit"].(*int), args["offset"].(*int), args["sort"].([]string))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "Admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*UserList); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/graphql/generated.UserList`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*UserList)
|
|
fc.Result = res
|
|
return ec.marshalNUserList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐUserList(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query_user_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
directive0 := func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().User(rctx, args["id"].(int))
|
|
}
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
yes, err := ec.unmarshalNBoolean2bool(ctx, true)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.Authenticated == nil {
|
|
return nil, errors.New("directive authenticated is not implemented")
|
|
}
|
|
return ec.directives.Authenticated(ctx, nil, directive0, yes)
|
|
}
|
|
directive2 := func(ctx context.Context) (interface{}, error) {
|
|
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, "Admin")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if ec.directives.HasRole == nil {
|
|
return nil, errors.New("directive hasRole is not implemented")
|
|
}
|
|
return ec.directives.HasRole(ctx, nil, directive1, role)
|
|
}
|
|
|
|
tmp, err := directive2(rctx)
|
|
if err != nil {
|
|
return nil, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
if tmp == nil {
|
|
return nil, nil
|
|
}
|
|
if data, ok := tmp.(*model.User); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/zdam-egzamin-zawodowy/backend/internal/model.User`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.User)
|
|
fc.Result = res
|
|
return ec.marshalOUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query_me(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Query().Me(rctx)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.User)
|
|
fc.Result = res
|
|
return ec.marshalOUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field_Query___type_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.introspectType(args["name"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.introspectSchema()
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Schema)
|
|
fc.Result = res
|
|
return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_id(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_from(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.From, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_content(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Content, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_explanation(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Explanation, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_correctAnswer(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CorrectAnswer, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(model.Answer)
|
|
fc.Result = res
|
|
return ec.marshalNAnswer2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐAnswer(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_image(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Image, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerA(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerA, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerAImage(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerAImage, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerB(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerB, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerBImage(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerBImage, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerC(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerC, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerCImage(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerCImage, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerD(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerD, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_answerDImage(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.AnswerDImage, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_qualification(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: true,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return ec.resolvers.Question().Qualification(rctx, obj)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.Qualification)
|
|
fc.Result = res
|
|
return ec.marshalOQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CreatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _Question_updatedAt(ctx context.Context, field graphql.CollectedField, obj *model.Question) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "Question",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.UpdatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _QuestionList_total(ctx context.Context, field graphql.CollectedField, obj *QuestionList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "QuestionList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Total, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _QuestionList_items(ctx context.Context, field graphql.CollectedField, obj *QuestionList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "QuestionList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Items, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.Question)
|
|
fc.Result = res
|
|
return ec.marshalOQuestion2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.ID, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNID2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _User_displayName(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DisplayName, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _User_role(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Role, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(model.Role)
|
|
fc.Result = res
|
|
return ec.marshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _User_email(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Email, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _User_activated(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Activated, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2ᚖbool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _User_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "User",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.CreatedAt, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(time.Time)
|
|
fc.Result = res
|
|
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _UserList_total(ctx context.Context, field graphql.CollectedField, obj *UserList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "UserList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Total, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(int)
|
|
fc.Result = res
|
|
return ec.marshalNInt2int(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _UserList_items(ctx context.Context, field graphql.CollectedField, obj *UserList) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "UserList",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Items, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]*model.User)
|
|
fc.Result = res
|
|
return ec.marshalOUser2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _UserWithToken_token(ctx context.Context, field graphql.CollectedField, obj *UserWithToken) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "UserWithToken",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Token, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) _UserWithToken_user(ctx context.Context, field graphql.CollectedField, obj *UserWithToken) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "UserWithToken",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.User, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.User)
|
|
fc.Result = res
|
|
return ec.marshalNUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Locations, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]string)
|
|
fc.Result = res
|
|
return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Args, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsRepeatable, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsDeprecated(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DeprecationReason(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Args, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Type, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.IsDeprecated(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DeprecationReason(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalNString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Type, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.DefaultValue, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Types(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.QueryType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.MutationType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.SubscriptionType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Directives(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Directive)
|
|
fc.Result = res
|
|
return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Kind(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
if !graphql.HasFieldError(ctx, fc) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalN__TypeKind2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Name(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(string)
|
|
fc.Result = res
|
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field___Type_fields_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Fields(args["includeDeprecated"].(bool)), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Field)
|
|
fc.Result = res
|
|
return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.Interfaces(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.PossibleTypes(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
rawArgs := field.ArgumentMap(ec.Variables)
|
|
args, err := ec.field___Type_enumValues_args(ctx, rawArgs)
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
fc.Args = args
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.EnumValues(args["includeDeprecated"].(bool)), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.EnumValue)
|
|
fc.Result = res
|
|
return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.InputFields(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = graphql.Null
|
|
}
|
|
}()
|
|
fc := &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
Args: nil,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
}
|
|
|
|
ctx = graphql.WithFieldContext(ctx, fc)
|
|
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
|
ctx = rctx // use context from middleware stack in children
|
|
return obj.OfType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
// endregion **************************** field.gotpl *****************************
|
|
|
|
// region **************************** input.gotpl *****************************
|
|
|
|
func (ec *executionContext) unmarshalInputProfessionFilter(ctx context.Context, obj interface{}) (model.ProfessionFilter, error) {
|
|
var it model.ProfessionFilter
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "id":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
it.ID, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "idNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ"))
|
|
it.IDNEQ, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "slug":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slug"))
|
|
it.Slug, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "slugNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slugNEQ"))
|
|
it.SlugNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "name":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
it.Name, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "nameNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ"))
|
|
it.NameNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "nameIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIEQ"))
|
|
it.NameIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "nameMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameMATCH"))
|
|
it.NameMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "descriptionIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIEQ"))
|
|
it.DescriptionIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "descriptionMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionMATCH"))
|
|
it.DescriptionMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "qualificationID":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("qualificationID"))
|
|
it.QualificationID, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAt":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
it.CreatedAt, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT"))
|
|
it.CreatedAtGT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE"))
|
|
it.CreatedAtGTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT"))
|
|
it.CreatedAtLT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE"))
|
|
it.CreatedAtLTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputProfessionInput(ctx context.Context, obj interface{}) (model.ProfessionInput, error) {
|
|
var it model.ProfessionInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "name":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
it.Name, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "description":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
|
it.Description, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputQualificationFilter(ctx context.Context, obj interface{}) (model.QualificationFilter, error) {
|
|
var it model.QualificationFilter
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "id":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
it.ID, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "idNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ"))
|
|
it.IDNEQ, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "slug":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slug"))
|
|
it.Slug, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "slugNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slugNEQ"))
|
|
it.SlugNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "formula":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("formula"))
|
|
it.Formula, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "formulaNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("formulaNEQ"))
|
|
it.FormulaNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "name":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
it.Name, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "nameNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameNEQ"))
|
|
it.NameNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "nameIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIEQ"))
|
|
it.NameIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "nameMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameMATCH"))
|
|
it.NameMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "code":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("code"))
|
|
it.Code, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "codeNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("codeNEQ"))
|
|
it.CodeNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "codeIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("codeIEQ"))
|
|
it.CodeIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "codeMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("codeMATCH"))
|
|
it.CodeMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "descriptionIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionIEQ"))
|
|
it.DescriptionIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "descriptionMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("descriptionMATCH"))
|
|
it.DescriptionMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "professionID":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("professionID"))
|
|
it.ProfessionID, err = ec.unmarshalOInt2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAt":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
it.CreatedAt, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT"))
|
|
it.CreatedAtGT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE"))
|
|
it.CreatedAtGTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT"))
|
|
it.CreatedAtLT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE"))
|
|
it.CreatedAtLTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "or":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or"))
|
|
it.Or, err = ec.unmarshalOQualificationFilterOr2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationFilterOr(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputQualificationFilterOr(ctx context.Context, obj interface{}) (model.QualificationFilterOr, error) {
|
|
var it model.QualificationFilterOr
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "nameMatch":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameMatch"))
|
|
it.NameMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "nameIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nameIEQ"))
|
|
it.NameIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "codeMatch":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("codeMatch"))
|
|
it.CodeMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "codeIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("codeIEQ"))
|
|
it.CodeIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputQualificationInput(ctx context.Context, obj interface{}) (model.QualificationInput, error) {
|
|
var it model.QualificationInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "name":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
it.Name, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "description":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
|
it.Description, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "code":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("code"))
|
|
it.Code, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "formula":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("formula"))
|
|
it.Formula, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "associateProfession":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("associateProfession"))
|
|
it.AssociateProfession, err = ec.unmarshalOInt2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "dissociateProfession":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dissociateProfession"))
|
|
it.DissociateProfession, err = ec.unmarshalOInt2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputQuestionFilter(ctx context.Context, obj interface{}) (model.QuestionFilter, error) {
|
|
var it model.QuestionFilter
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "id":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
it.ID, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "idNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ"))
|
|
it.IDNEQ, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "from":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from"))
|
|
it.From, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "contentIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentIEQ"))
|
|
it.ContentIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "contentMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("contentMATCH"))
|
|
it.ContentMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "qualificationID":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("qualificationID"))
|
|
it.QualificationID, err = ec.unmarshalOInt2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "qualificationIDNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("qualificationIDNEQ"))
|
|
it.QualificationIDNEQ, err = ec.unmarshalOInt2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "qualificationFilter":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("qualificationFilter"))
|
|
it.QualificationFilter, err = ec.unmarshalOQualificationFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationFilter(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAt":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
it.CreatedAt, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT"))
|
|
it.CreatedAtGT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE"))
|
|
it.CreatedAtGTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT"))
|
|
it.CreatedAtLT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE"))
|
|
it.CreatedAtLTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputQuestionInput(ctx context.Context, obj interface{}) (model.QuestionInput, error) {
|
|
var it model.QuestionInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "content":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("content"))
|
|
it.Content, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "from":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from"))
|
|
it.From, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "explanation":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("explanation"))
|
|
it.Explanation, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "correctAnswer":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("correctAnswer"))
|
|
it.CorrectAnswer, err = ec.unmarshalOAnswer2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐAnswer(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "qualificationID":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("qualificationID"))
|
|
it.QualificationID, err = ec.unmarshalOInt2ᚖint(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "image":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image"))
|
|
it.Image, err = ec.unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "deleteImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deleteImage"))
|
|
it.DeleteImage, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerA":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerA"))
|
|
it.AnswerA, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerAImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerAImage"))
|
|
it.AnswerAImage, err = ec.unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "deleteAnswerAImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deleteAnswerAImage"))
|
|
it.DeleteAnswerAImage, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerB":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerB"))
|
|
it.AnswerB, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerBImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerBImage"))
|
|
it.AnswerBImage, err = ec.unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "deleteAnswerBImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deleteAnswerBImage"))
|
|
it.DeleteAnswerBImage, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerC":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerC"))
|
|
it.AnswerC, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerCImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerCImage"))
|
|
it.AnswerCImage, err = ec.unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "deleteAnswerCImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deleteAnswerCImage"))
|
|
it.DeleteAnswerCImage, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerD":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerD"))
|
|
it.AnswerD, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "answerDImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("answerDImage"))
|
|
it.AnswerDImage, err = ec.unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "deleteAnswerDImage":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deleteAnswerDImage"))
|
|
it.DeleteAnswerDImage, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputUpdateManyUsersInput(ctx context.Context, obj interface{}) (model.UserInput, error) {
|
|
var it model.UserInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "role":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role"))
|
|
it.Role, err = ec.unmarshalORole2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "activated":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activated"))
|
|
it.Activated, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputUserFilter(ctx context.Context, obj interface{}) (model.UserFilter, error) {
|
|
var it model.UserFilter
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "id":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
|
|
it.ID, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "idNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("idNEQ"))
|
|
it.IDNEQ, err = ec.unmarshalOID2ᚕintᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "activated":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activated"))
|
|
it.Activated, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "displayName":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName"))
|
|
it.DisplayName, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "displayNameNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameNEQ"))
|
|
it.DisplayNameNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "displayNameIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIEQ"))
|
|
it.DisplayNameIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "displayNameMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameMATCH"))
|
|
it.DisplayNameMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "email":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
|
|
it.Email, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "emailNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailNEQ"))
|
|
it.EmailNEQ, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "emailIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIEQ"))
|
|
it.EmailIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "emailMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailMATCH"))
|
|
it.EmailMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "role":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role"))
|
|
it.Role, err = ec.unmarshalORole2ᚕgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRoleᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "roleNEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("roleNEQ"))
|
|
it.RoleNEQ, err = ec.unmarshalORole2ᚕgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRoleᚄ(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAt":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAt"))
|
|
it.CreatedAt, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGT"))
|
|
it.CreatedAtGT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtGTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtGTE"))
|
|
it.CreatedAtGTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLT":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLT"))
|
|
it.CreatedAtLT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "createdAtLTE":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("createdAtLTE"))
|
|
it.CreatedAtLTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "or":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("or"))
|
|
it.Or, err = ec.unmarshalOUserFilterOr2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserFilterOr(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputUserFilterOr(ctx context.Context, obj interface{}) (model.UserFilterOr, error) {
|
|
var it model.UserFilterOr
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "displayNameIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameIEQ"))
|
|
it.DisplayNameIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "displayNameMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayNameMATCH"))
|
|
it.DisplayNameMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "emailIEQ":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailIEQ"))
|
|
it.EmailIEQ, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "emailMATCH":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("emailMATCH"))
|
|
it.EmailMATCH, err = ec.unmarshalOString2string(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputUserInput(ctx context.Context, obj interface{}) (model.UserInput, error) {
|
|
var it model.UserInput
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
for k, v := range asMap {
|
|
switch k {
|
|
case "displayName":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName"))
|
|
it.DisplayName, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "password":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password"))
|
|
it.Password, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "email":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
|
|
it.Email, err = ec.unmarshalOString2ᚖstring(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "role":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("role"))
|
|
it.Role, err = ec.unmarshalORole2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
case "activated":
|
|
var err error
|
|
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activated"))
|
|
it.Activated, err = ec.unmarshalOBoolean2ᚖbool(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
// endregion **************************** input.gotpl *****************************
|
|
|
|
// region ************************** interface.gotpl ***************************
|
|
|
|
// endregion ************************** interface.gotpl ***************************
|
|
|
|
// region **************************** object.gotpl ****************************
|
|
|
|
var mutationImplementors = []string{"Mutation"}
|
|
|
|
func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)
|
|
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
})
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Mutation")
|
|
case "createProfession":
|
|
out.Values[i] = ec._Mutation_createProfession(ctx, field)
|
|
case "updateProfession":
|
|
out.Values[i] = ec._Mutation_updateProfession(ctx, field)
|
|
case "deleteProfessions":
|
|
out.Values[i] = ec._Mutation_deleteProfessions(ctx, field)
|
|
case "createQualification":
|
|
out.Values[i] = ec._Mutation_createQualification(ctx, field)
|
|
case "updateQualification":
|
|
out.Values[i] = ec._Mutation_updateQualification(ctx, field)
|
|
case "deleteQualifications":
|
|
out.Values[i] = ec._Mutation_deleteQualifications(ctx, field)
|
|
case "createQuestion":
|
|
out.Values[i] = ec._Mutation_createQuestion(ctx, field)
|
|
case "updateQuestion":
|
|
out.Values[i] = ec._Mutation_updateQuestion(ctx, field)
|
|
case "deleteQuestions":
|
|
out.Values[i] = ec._Mutation_deleteQuestions(ctx, field)
|
|
case "createUser":
|
|
out.Values[i] = ec._Mutation_createUser(ctx, field)
|
|
case "updateUser":
|
|
out.Values[i] = ec._Mutation_updateUser(ctx, field)
|
|
case "updateManyUsers":
|
|
out.Values[i] = ec._Mutation_updateManyUsers(ctx, field)
|
|
case "deleteUsers":
|
|
out.Values[i] = ec._Mutation_deleteUsers(ctx, field)
|
|
case "signIn":
|
|
out.Values[i] = ec._Mutation_signIn(ctx, field)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var professionImplementors = []string{"Profession"}
|
|
|
|
func (ec *executionContext) _Profession(ctx context.Context, sel ast.SelectionSet, obj *model.Profession) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, professionImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Profession")
|
|
case "id":
|
|
out.Values[i] = ec._Profession_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "slug":
|
|
out.Values[i] = ec._Profession_slug(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "name":
|
|
out.Values[i] = ec._Profession_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec._Profession_description(ctx, field, obj)
|
|
case "createdAt":
|
|
out.Values[i] = ec._Profession_createdAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "qualifications":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Profession_qualifications(ctx, field, obj)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
return res
|
|
})
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var professionListImplementors = []string{"ProfessionList"}
|
|
|
|
func (ec *executionContext) _ProfessionList(ctx context.Context, sel ast.SelectionSet, obj *ProfessionList) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, professionListImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("ProfessionList")
|
|
case "total":
|
|
out.Values[i] = ec._ProfessionList_total(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "items":
|
|
out.Values[i] = ec._ProfessionList_items(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var qualificationImplementors = []string{"Qualification"}
|
|
|
|
func (ec *executionContext) _Qualification(ctx context.Context, sel ast.SelectionSet, obj *model.Qualification) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, qualificationImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Qualification")
|
|
case "id":
|
|
out.Values[i] = ec._Qualification_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "slug":
|
|
out.Values[i] = ec._Qualification_slug(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "name":
|
|
out.Values[i] = ec._Qualification_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "code":
|
|
out.Values[i] = ec._Qualification_code(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "formula":
|
|
out.Values[i] = ec._Qualification_formula(ctx, field, obj)
|
|
case "description":
|
|
out.Values[i] = ec._Qualification_description(ctx, field, obj)
|
|
case "createdAt":
|
|
out.Values[i] = ec._Qualification_createdAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var qualificationListImplementors = []string{"QualificationList"}
|
|
|
|
func (ec *executionContext) _QualificationList(ctx context.Context, sel ast.SelectionSet, obj *QualificationList) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, qualificationListImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("QualificationList")
|
|
case "total":
|
|
out.Values[i] = ec._QualificationList_total(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "items":
|
|
out.Values[i] = ec._QualificationList_items(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var queryImplementors = []string{"Query"}
|
|
|
|
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
|
|
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Query",
|
|
})
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Query")
|
|
case "professions":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_professions(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
return res
|
|
})
|
|
case "profession":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_profession(ctx, field)
|
|
return res
|
|
})
|
|
case "qualifications":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_qualifications(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
return res
|
|
})
|
|
case "similarQualifications":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_similarQualifications(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
return res
|
|
})
|
|
case "qualification":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_qualification(ctx, field)
|
|
return res
|
|
})
|
|
case "questions":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_questions(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
return res
|
|
})
|
|
case "generateTest":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_generateTest(ctx, field)
|
|
return res
|
|
})
|
|
case "users":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_users(ctx, field)
|
|
if res == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
return res
|
|
})
|
|
case "user":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_user(ctx, field)
|
|
return res
|
|
})
|
|
case "me":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Query_me(ctx, field)
|
|
return res
|
|
})
|
|
case "__type":
|
|
out.Values[i] = ec._Query___type(ctx, field)
|
|
case "__schema":
|
|
out.Values[i] = ec._Query___schema(ctx, field)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var questionImplementors = []string{"Question"}
|
|
|
|
func (ec *executionContext) _Question(ctx context.Context, sel ast.SelectionSet, obj *model.Question) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, questionImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("Question")
|
|
case "id":
|
|
out.Values[i] = ec._Question_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "from":
|
|
out.Values[i] = ec._Question_from(ctx, field, obj)
|
|
case "content":
|
|
out.Values[i] = ec._Question_content(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "explanation":
|
|
out.Values[i] = ec._Question_explanation(ctx, field, obj)
|
|
case "correctAnswer":
|
|
out.Values[i] = ec._Question_correctAnswer(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "image":
|
|
out.Values[i] = ec._Question_image(ctx, field, obj)
|
|
case "answerA":
|
|
out.Values[i] = ec._Question_answerA(ctx, field, obj)
|
|
case "answerAImage":
|
|
out.Values[i] = ec._Question_answerAImage(ctx, field, obj)
|
|
case "answerB":
|
|
out.Values[i] = ec._Question_answerB(ctx, field, obj)
|
|
case "answerBImage":
|
|
out.Values[i] = ec._Question_answerBImage(ctx, field, obj)
|
|
case "answerC":
|
|
out.Values[i] = ec._Question_answerC(ctx, field, obj)
|
|
case "answerCImage":
|
|
out.Values[i] = ec._Question_answerCImage(ctx, field, obj)
|
|
case "answerD":
|
|
out.Values[i] = ec._Question_answerD(ctx, field, obj)
|
|
case "answerDImage":
|
|
out.Values[i] = ec._Question_answerDImage(ctx, field, obj)
|
|
case "qualification":
|
|
field := field
|
|
out.Concurrently(i, func() (res graphql.Marshaler) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
}
|
|
}()
|
|
res = ec._Question_qualification(ctx, field, obj)
|
|
return res
|
|
})
|
|
case "createdAt":
|
|
out.Values[i] = ec._Question_createdAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
case "updatedAt":
|
|
out.Values[i] = ec._Question_updatedAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
atomic.AddUint32(&invalids, 1)
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var questionListImplementors = []string{"QuestionList"}
|
|
|
|
func (ec *executionContext) _QuestionList(ctx context.Context, sel ast.SelectionSet, obj *QuestionList) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, questionListImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("QuestionList")
|
|
case "total":
|
|
out.Values[i] = ec._QuestionList_total(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "items":
|
|
out.Values[i] = ec._QuestionList_items(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var userImplementors = []string{"User"}
|
|
|
|
func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, userImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("User")
|
|
case "id":
|
|
out.Values[i] = ec._User_id(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "displayName":
|
|
out.Values[i] = ec._User_displayName(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "role":
|
|
out.Values[i] = ec._User_role(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "email":
|
|
out.Values[i] = ec._User_email(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "activated":
|
|
out.Values[i] = ec._User_activated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "createdAt":
|
|
out.Values[i] = ec._User_createdAt(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var userListImplementors = []string{"UserList"}
|
|
|
|
func (ec *executionContext) _UserList(ctx context.Context, sel ast.SelectionSet, obj *UserList) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, userListImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("UserList")
|
|
case "total":
|
|
out.Values[i] = ec._UserList_total(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "items":
|
|
out.Values[i] = ec._UserList_items(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var userWithTokenImplementors = []string{"UserWithToken"}
|
|
|
|
func (ec *executionContext) _UserWithToken(ctx context.Context, sel ast.SelectionSet, obj *UserWithToken) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, userWithTokenImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("UserWithToken")
|
|
case "token":
|
|
out.Values[i] = ec._UserWithToken_token(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "user":
|
|
out.Values[i] = ec._UserWithToken_user(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var __DirectiveImplementors = []string{"__Directive"}
|
|
|
|
func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Directive")
|
|
case "name":
|
|
out.Values[i] = ec.___Directive_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___Directive_description(ctx, field, obj)
|
|
case "locations":
|
|
out.Values[i] = ec.___Directive_locations(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "args":
|
|
out.Values[i] = ec.___Directive_args(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "isRepeatable":
|
|
out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var __EnumValueImplementors = []string{"__EnumValue"}
|
|
|
|
func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__EnumValue")
|
|
case "name":
|
|
out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
|
|
case "isDeprecated":
|
|
out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "deprecationReason":
|
|
out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var __FieldImplementors = []string{"__Field"}
|
|
|
|
func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Field")
|
|
case "name":
|
|
out.Values[i] = ec.___Field_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___Field_description(ctx, field, obj)
|
|
case "args":
|
|
out.Values[i] = ec.___Field_args(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "type":
|
|
out.Values[i] = ec.___Field_type(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "isDeprecated":
|
|
out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "deprecationReason":
|
|
out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var __InputValueImplementors = []string{"__InputValue"}
|
|
|
|
func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__InputValue")
|
|
case "name":
|
|
out.Values[i] = ec.___InputValue_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___InputValue_description(ctx, field, obj)
|
|
case "type":
|
|
out.Values[i] = ec.___InputValue_type(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "defaultValue":
|
|
out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var __SchemaImplementors = []string{"__Schema"}
|
|
|
|
func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Schema")
|
|
case "types":
|
|
out.Values[i] = ec.___Schema_types(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "queryType":
|
|
out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "mutationType":
|
|
out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
|
|
case "subscriptionType":
|
|
out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
|
|
case "directives":
|
|
out.Values[i] = ec.___Schema_directives(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
var __TypeImplementors = []string{"__Type"}
|
|
|
|
func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
var invalids uint32
|
|
for i, field := range fields {
|
|
switch field.Name {
|
|
case "__typename":
|
|
out.Values[i] = graphql.MarshalString("__Type")
|
|
case "kind":
|
|
out.Values[i] = ec.___Type_kind(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
invalids++
|
|
}
|
|
case "name":
|
|
out.Values[i] = ec.___Type_name(ctx, field, obj)
|
|
case "description":
|
|
out.Values[i] = ec.___Type_description(ctx, field, obj)
|
|
case "fields":
|
|
out.Values[i] = ec.___Type_fields(ctx, field, obj)
|
|
case "interfaces":
|
|
out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
|
|
case "possibleTypes":
|
|
out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
|
|
case "enumValues":
|
|
out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
|
|
case "inputFields":
|
|
out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
|
|
case "ofType":
|
|
out.Values[i] = ec.___Type_ofType(ctx, field, obj)
|
|
default:
|
|
panic("unknown field " + strconv.Quote(field.Name))
|
|
}
|
|
}
|
|
out.Dispatch()
|
|
if invalids > 0 {
|
|
return graphql.Null
|
|
}
|
|
return out
|
|
}
|
|
|
|
// endregion **************************** object.gotpl ****************************
|
|
|
|
// region ***************************** type.gotpl *****************************
|
|
|
|
func (ec *executionContext) unmarshalNAnswer2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐAnswer(ctx context.Context, v interface{}) (model.Answer, error) {
|
|
var res model.Answer
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNAnswer2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐAnswer(ctx context.Context, sel ast.SelectionSet, v model.Answer) graphql.Marshaler {
|
|
return v
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
|
|
res := graphql.MarshalBoolean(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) {
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalBoolean(*v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNID2int(ctx context.Context, v interface{}) (int, error) {
|
|
res, err := graphql.UnmarshalInt(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNID2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler {
|
|
res := graphql.MarshalInt(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNID2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) {
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
if tmp1, ok := v.([]interface{}); ok {
|
|
vSlice = tmp1
|
|
} else {
|
|
vSlice = []interface{}{v}
|
|
}
|
|
}
|
|
var err error
|
|
res := make([]int, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNID2int(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalNID2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNID2int(ctx, sel, v[i])
|
|
}
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) {
|
|
res, err := graphql.UnmarshalInt(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler {
|
|
res := graphql.MarshalInt(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) marshalNProfession2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfession(ctx context.Context, sel ast.SelectionSet, v *model.Profession) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Profession(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNProfessionInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionInput(ctx context.Context, v interface{}) (model.ProfessionInput, error) {
|
|
res, err := ec.unmarshalInputProfessionInput(ctx, v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNProfessionList2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐProfessionList(ctx context.Context, sel ast.SelectionSet, v ProfessionList) graphql.Marshaler {
|
|
return ec._ProfessionList(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNProfessionList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐProfessionList(ctx context.Context, sel ast.SelectionSet, v *ProfessionList) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._ProfessionList(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQualification2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Qualification) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx context.Context, sel ast.SelectionSet, v *model.Qualification) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Qualification(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNQualificationInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationInput(ctx context.Context, v interface{}) (model.QualificationInput, error) {
|
|
res, err := ec.unmarshalInputQualificationInput(ctx, v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQualificationList2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐQualificationList(ctx context.Context, sel ast.SelectionSet, v QualificationList) graphql.Marshaler {
|
|
return ec._QualificationList(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQualificationList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐQualificationList(ctx context.Context, sel ast.SelectionSet, v *QualificationList) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._QualificationList(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQuestion2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestion(ctx context.Context, sel ast.SelectionSet, v *model.Question) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._Question(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNQuestionInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionInput(ctx context.Context, v interface{}) (model.QuestionInput, error) {
|
|
res, err := ec.unmarshalInputQuestionInput(ctx, v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQuestionList2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐQuestionList(ctx context.Context, sel ast.SelectionSet, v QuestionList) graphql.Marshaler {
|
|
return ec._QuestionList(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQuestionList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐQuestionList(ctx context.Context, sel ast.SelectionSet, v *QuestionList) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._QuestionList(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx context.Context, v interface{}) (model.Role, error) {
|
|
var res model.Role
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx context.Context, sel ast.SelectionSet, v model.Role) graphql.Marshaler {
|
|
return v
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) {
|
|
res, err := graphql.UnmarshalTime(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler {
|
|
res := graphql.MarshalTime(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNUpdateManyUsersInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserInput(ctx context.Context, v interface{}) (model.UserInput, error) {
|
|
res, err := ec.unmarshalInputUpdateManyUsersInput(ctx, v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._User(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNUserInput2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserInput(ctx context.Context, v interface{}) (model.UserInput, error) {
|
|
res, err := ec.unmarshalInputUserInput(ctx, v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNUserList2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐUserList(ctx context.Context, sel ast.SelectionSet, v UserList) graphql.Marshaler {
|
|
return ec._UserList(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNUserList2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐUserList(ctx context.Context, sel ast.SelectionSet, v *UserList) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._UserList(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
|
|
return ec.___Directive(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
if tmp1, ok := v.([]interface{}); ok {
|
|
vSlice = tmp1
|
|
} else {
|
|
vSlice = []interface{}{v}
|
|
}
|
|
}
|
|
var err error
|
|
res := make([]string, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler {
|
|
return ec.___EnumValue(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler {
|
|
return ec.___Field(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler {
|
|
return ec.___InputValue(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
|
|
return ec.___Type(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
|
|
if v == nil {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec.___Type(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(v)
|
|
if res == graphql.Null {
|
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
|
ec.Errorf(ctx, "must not be null")
|
|
}
|
|
}
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOAnswer2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐAnswer(ctx context.Context, v interface{}) (*model.Answer, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var res = new(model.Answer)
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOAnswer2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐAnswer(ctx context.Context, sel ast.SelectionSet, v *model.Answer) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return v
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
|
|
return graphql.MarshalBoolean(v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return graphql.MarshalBoolean(*v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOID2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
if tmp1, ok := v.([]interface{}); ok {
|
|
vSlice = tmp1
|
|
} else {
|
|
vSlice = []interface{}{v}
|
|
}
|
|
}
|
|
var err error
|
|
res := make([]int, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNID2int(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalOID2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNID2int(ctx, sel, v[i])
|
|
}
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOID2ᚖint(ctx context.Context, v interface{}) (*int, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalInt(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOID2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return graphql.MarshalInt(*v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
if tmp1, ok := v.([]interface{}); ok {
|
|
vSlice = tmp1
|
|
} else {
|
|
vSlice = []interface{}{v}
|
|
}
|
|
}
|
|
var err error
|
|
res := make([]int, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalOInt2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNInt2int(ctx, sel, v[i])
|
|
}
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalInt(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return graphql.MarshalInt(*v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOProfession2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Profession) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNProfession2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfession(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalOProfession2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfession(ctx context.Context, sel ast.SelectionSet, v *model.Profession) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Profession(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOProfessionFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐProfessionFilter(ctx context.Context, v interface{}) (*model.ProfessionFilter, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputProfessionFilter(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOQualification2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Qualification) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalOQualification2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualification(ctx context.Context, sel ast.SelectionSet, v *model.Qualification) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Qualification(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOQualificationFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationFilter(ctx context.Context, v interface{}) (*model.QualificationFilter, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputQualificationFilter(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOQualificationFilterOr2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQualificationFilterOr(ctx context.Context, v interface{}) (*model.QualificationFilterOr, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputQualificationFilterOr(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOQuestion2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Question) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNQuestion2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestion(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalOQuestion2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestion(ctx context.Context, sel ast.SelectionSet, v *model.Question) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Question(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOQuestionFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐQuestionFilter(ctx context.Context, v interface{}) (*model.QuestionFilter, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputQuestionFilter(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalORole2ᚕgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRoleᚄ(ctx context.Context, v interface{}) ([]model.Role, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
if tmp1, ok := v.([]interface{}); ok {
|
|
vSlice = tmp1
|
|
} else {
|
|
vSlice = []interface{}{v}
|
|
}
|
|
}
|
|
var err error
|
|
res := make([]model.Role, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalORole2ᚕgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRoleᚄ(ctx context.Context, sel ast.SelectionSet, v []model.Role) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalORole2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx context.Context, v interface{}) (*model.Role, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var res = new(model.Role)
|
|
err := res.UnmarshalGQL(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalORole2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐRole(ctx context.Context, sel ast.SelectionSet, v *model.Role) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return v
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
return graphql.MarshalString(v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
if tmp1, ok := v.([]interface{}); ok {
|
|
vSlice = tmp1
|
|
} else {
|
|
vSlice = []interface{}{v}
|
|
}
|
|
}
|
|
var err error
|
|
res := make([]string, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNString2string(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNString2string(ctx, sel, v[i])
|
|
}
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalString(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return graphql.MarshalString(*v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) {
|
|
res, err := graphql.UnmarshalTime(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler {
|
|
return graphql.MarshalTime(v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v interface{}) (*graphql.Upload, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalUpload(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, sel ast.SelectionSet, v *graphql.Upload) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return graphql.MarshalUpload(*v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOUser2ᚕᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.User) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalNUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalOUser2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._User(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOUserFilter2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserFilter(ctx context.Context, v interface{}) (*model.UserFilter, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputUserFilter(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOUserFilterOr2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelᚐUserFilterOr(ctx context.Context, v interface{}) (*model.UserFilterOr, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputUserFilterOr(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOUserWithToken2ᚖgithubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋgraphqlᚋgeneratedᚐUserWithToken(ctx context.Context, sel ast.SelectionSet, v *UserWithToken) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._UserWithToken(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec.___Schema(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
var wg sync.WaitGroup
|
|
isLen1 := len(v) == 1
|
|
if !isLen1 {
|
|
wg.Add(len(v))
|
|
}
|
|
for i := range v {
|
|
i := i
|
|
fc := &graphql.FieldContext{
|
|
Index: &i,
|
|
Result: &v[i],
|
|
}
|
|
ctx := graphql.WithFieldContext(ctx, fc)
|
|
f := func(i int) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
ec.Error(ctx, ec.Recover(ctx, r))
|
|
ret = nil
|
|
}
|
|
}()
|
|
if !isLen1 {
|
|
defer wg.Done()
|
|
}
|
|
ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
|
|
}
|
|
if isLen1 {
|
|
f(i)
|
|
} else {
|
|
go f(i)
|
|
}
|
|
|
|
}
|
|
wg.Wait()
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec.___Type(ctx, sel, v)
|
|
}
|
|
|
|
// endregion ***************************** type.gotpl *****************************
|