update schema

This commit is contained in:
Dawid Wysokiński 2021-04-05 12:22:54 +02:00
parent afaea39c5e
commit 68c0509c54
6 changed files with 27 additions and 12 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-20210326220804-49726bf1d181 // indirect
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // 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-20210326220804-49726bf1d181 h1:64ChN/hjER/taL4YJuA+gpLfIMT+/NFherRZixbxOhg=
golang.org/x/sys v0.0.0-20210326220804-49726bf1d181/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/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

@ -930,7 +930,7 @@ extend type Query {
offset: Int
sort: [String!]
): ProfessionList!
profession(id: Int, slug: String): Profession
profession(id: ID, slug: String): Profession
}
extend type Mutation {
@ -1024,7 +1024,7 @@ extend type Query {
offset: Int
sort: [String!]
): QualificationList!
qualification(id: Int, slug: String): Qualification
qualification(id: ID, slug: String): Qualification
}
extend type Mutation {
@ -1218,7 +1218,7 @@ extend type Query {
offset: Int
sort: [String!]
): UserList! @authenticated(yes: true) @hasRole(role: Admin)
user(id: Int!): User @authenticated(yes: true) @hasRole(role: Admin)
user(id: ID!): User @authenticated(yes: true) @hasRole(role: Admin)
me: User
}
@ -1597,7 +1597,7 @@ func (ec *executionContext) field_Query_profession_args(ctx context.Context, raw
var arg0 *int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
arg0, err = ec.unmarshalOID2ᚖint(ctx, tmp)
if err != nil {
return nil, err
}
@ -1663,7 +1663,7 @@ func (ec *executionContext) field_Query_qualification_args(ctx context.Context,
var arg0 *int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
arg0, err = ec.unmarshalOID2ᚖint(ctx, tmp)
if err != nil {
return nil, err
}
@ -1813,7 +1813,7 @@ func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs m
var arg0 int
if tmp, ok := rawArgs["id"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
arg0, err = ec.unmarshalNInt2int(ctx, tmp)
arg0, err = ec.unmarshalNID2int(ctx, tmp)
if err != nil {
return nil, err
}
@ -8621,6 +8621,21 @@ func (ec *executionContext) marshalOID2ᚕintᚄ(ctx context.Context, sel ast.Se
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

View File

@ -48,7 +48,7 @@ extend type Query {
offset: Int
sort: [String!]
): ProfessionList!
profession(id: Int, slug: String): Profession
profession(id: ID, slug: String): Profession
}
extend type Mutation {

View File

@ -77,7 +77,7 @@ extend type Query {
offset: Int
sort: [String!]
): QualificationList!
qualification(id: Int, slug: String): Qualification
qualification(id: ID, slug: String): Qualification
}
extend type Mutation {

View File

@ -78,7 +78,7 @@ extend type Query {
offset: Int
sort: [String!]
): UserList! @authenticated(yes: true) @hasRole(role: Admin)
user(id: Int!): User @authenticated(yes: true) @hasRole(role: Admin)
user(id: ID!): User @authenticated(yes: true) @hasRole(role: Admin)
me: User
}