update schema

This commit is contained in:
Dawid Wysokiński 2021-03-09 19:42:29 +01:00
parent 16caa7bbe9
commit 419c1f7aaf
7 changed files with 57 additions and 57 deletions

2
go.mod
View File

@ -19,7 +19,7 @@ require (
github.com/sirupsen/logrus v1.8.0
github.com/vektah/gqlparser/v2 v2.1.0
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b // indirect
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

4
go.sum
View File

@ -223,8 +223,8 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b h1:ggRgirZABFolTmi3sn6Ivd9SipZwLedQ5wR0aAKnFxU=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY=
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=

View File

@ -907,13 +907,13 @@ extend type Query {
extend type Mutation {
createProfession(input: ProfessionInput!): Profession
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateProfession(id: ID!, input: ProfessionInput!): Profession
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteProfessions(ids: [ID!]!): [Profession!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
}
`, BuiltIn: false},
{Name: "schema/qualification.graphql", Input: `type Qualification {
@ -995,20 +995,20 @@ extend type Query {
extend type Mutation {
createQualification(input: QualificationInput!): Qualification
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateQualification(id: ID!, input: QualificationInput!): Qualification
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteQualifications(ids: [ID!]!): [Qualification!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
}
`, BuiltIn: false},
{Name: "schema/question.graphql", Input: `enum Answer {
A
B
C
D
a
b
c
d
}
type Question {
@ -1084,28 +1084,28 @@ extend type Query {
limit: Int
offset: Int
sort: [String!]
): QuestionList! @authenticated(yes: true) @hasRole(role: Admin)
): 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)
@hasRole(role: admin)
updateQuestion(id: ID!, input: QuestionInput!): Question
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteQuestions(ids: [ID!]!): [Question!]
@authenticated(yes: true)
@hasRole(role: Admin)
@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
admin
user
}
type User {
@ -1180,16 +1180,16 @@ extend type Query {
extend type Mutation {
createUser(input: UserInput!): User
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateUser(id: ID!, input: UserInput!): User
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateManyUsers(ids: [ID!]!, input: UpdateManyUsersInput!): [User!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteUsers(ids: [ID!]!): [User!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
signIn(
email: String!
password: String!
@ -1854,7 +1854,7 @@ func (ec *executionContext) _Mutation_createProfession(ctx context.Context, fiel
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -1927,7 +1927,7 @@ func (ec *executionContext) _Mutation_updateProfession(ctx context.Context, fiel
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2000,7 +2000,7 @@ func (ec *executionContext) _Mutation_deleteProfessions(ctx context.Context, fie
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2073,7 +2073,7 @@ func (ec *executionContext) _Mutation_createQualification(ctx context.Context, f
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2146,7 +2146,7 @@ func (ec *executionContext) _Mutation_updateQualification(ctx context.Context, f
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2219,7 +2219,7 @@ func (ec *executionContext) _Mutation_deleteQualifications(ctx context.Context,
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2292,7 +2292,7 @@ func (ec *executionContext) _Mutation_createQuestion(ctx context.Context, field
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2365,7 +2365,7 @@ func (ec *executionContext) _Mutation_updateQuestion(ctx context.Context, field
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2438,7 +2438,7 @@ func (ec *executionContext) _Mutation_deleteQuestions(ctx context.Context, field
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2511,7 +2511,7 @@ func (ec *executionContext) _Mutation_createUser(ctx context.Context, field grap
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2584,7 +2584,7 @@ func (ec *executionContext) _Mutation_updateUser(ctx context.Context, field grap
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2657,7 +2657,7 @@ func (ec *executionContext) _Mutation_updateManyUsers(ctx context.Context, field
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -2730,7 +2730,7 @@ func (ec *executionContext) _Mutation_deleteUsers(ctx context.Context, field gra
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}
@ -3573,7 +3573,7 @@ func (ec *executionContext) _Query_questions(ctx context.Context, field graphql.
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ᚋmodelsᚐRole(ctx, "Admin")
role, err := ec.unmarshalNRole2githubᚗcomᚋzdamᚑegzaminᚑzawodowyᚋbackendᚋinternalᚋmodelsᚐRole(ctx, "admin")
if err != nil {
return nil, err
}

View File

@ -51,11 +51,11 @@ extend type Query {
extend type Mutation {
createProfession(input: ProfessionInput!): Profession
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateProfession(id: ID!, input: ProfessionInput!): Profession
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteProfessions(ids: [ID!]!): [Profession!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
}

View File

@ -77,11 +77,11 @@ extend type Query {
extend type Mutation {
createQualification(input: QualificationInput!): Qualification
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateQualification(id: ID!, input: QualificationInput!): Qualification
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteQualifications(ids: [ID!]!): [Qualification!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
}

View File

@ -1,8 +1,8 @@
enum Answer {
A
B
C
D
a
b
c
d
}
type Question {
@ -78,18 +78,18 @@ extend type Query {
limit: Int
offset: Int
sort: [String!]
): QuestionList! @authenticated(yes: true) @hasRole(role: Admin)
): 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)
@hasRole(role: admin)
updateQuestion(id: ID!, input: QuestionInput!): Question
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteQuestions(ids: [ID!]!): [Question!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
}

View File

@ -1,6 +1,6 @@
enum Role {
Admin
User
admin
user
}
type User {
@ -75,16 +75,16 @@ extend type Query {
extend type Mutation {
createUser(input: UserInput!): User
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateUser(id: ID!, input: UserInput!): User
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
updateManyUsers(ids: [ID!]!, input: UpdateManyUsersInput!): [User!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
deleteUsers(ids: [ID!]!): [User!]
@authenticated(yes: true)
@hasRole(role: Admin)
@hasRole(role: admin)
signIn(
email: String!
password: String!