Resolves #19
This commit is contained in:
@@ -70,10 +70,6 @@ type ComplexityRoot struct {
|
||||
Users func(childComplexity int) int
|
||||
}
|
||||
|
||||
Response struct {
|
||||
Message func(childComplexity int) int
|
||||
}
|
||||
|
||||
User struct {
|
||||
CreatedAt func(childComplexity int) int
|
||||
Email func(childComplexity int) int
|
||||
@@ -99,7 +95,7 @@ type ComplexityRoot struct {
|
||||
}
|
||||
|
||||
type MutationResolver interface {
|
||||
VerifySignupToken(ctx context.Context, params model.VerifySignupTokenInput) (*model.Response, error)
|
||||
VerifySignupToken(ctx context.Context, params model.VerifySignupTokenInput) (*model.LoginResponse, error)
|
||||
BasicAuthSignUp(ctx context.Context, params model.BasicAuthSignupInput) (*model.BasicAuthSignupResponse, error)
|
||||
Login(ctx context.Context, params model.LoginInput) (*model.LoginResponse, error)
|
||||
}
|
||||
@@ -222,13 +218,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Query.Users(childComplexity), true
|
||||
|
||||
case "Response.message":
|
||||
if e.complexity.Response.Message == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Response.Message(childComplexity), true
|
||||
|
||||
case "User.createdAt":
|
||||
if e.complexity.User.CreatedAt == nil {
|
||||
break
|
||||
@@ -445,10 +434,6 @@ type Error {
|
||||
reason: String!
|
||||
}
|
||||
|
||||
type Response {
|
||||
message: String!
|
||||
}
|
||||
|
||||
type LoginResponse {
|
||||
message: String!
|
||||
accessToken: String
|
||||
@@ -479,7 +464,7 @@ input VerifySignupTokenInput {
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
verifySignupToken(params: VerifySignupTokenInput!): Response!
|
||||
verifySignupToken(params: VerifySignupTokenInput!): LoginResponse!
|
||||
basicAuthSignUp(params: BasicAuthSignupInput!): BasicAuthSignupResponse!
|
||||
login(params: LoginInput!): LoginResponse!
|
||||
}
|
||||
@@ -867,9 +852,9 @@ func (ec *executionContext) _Mutation_verifySignupToken(ctx context.Context, fie
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*model.Response)
|
||||
res := resTmp.(*model.LoginResponse)
|
||||
fc.Result = res
|
||||
return ec.marshalNResponse2ᚖgithubᚗcomᚋyauthdevᚋyauthᚋserverᚋgraphᚋmodelᚐResponse(ctx, field.Selections, res)
|
||||
return ec.marshalNLoginResponse2ᚖgithubᚗcomᚋyauthdevᚋyauthᚋserverᚋgraphᚋmodelᚐLoginResponse(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Mutation_basicAuthSignUp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
@@ -1094,41 +1079,6 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C
|
||||
return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Response_message(ctx context.Context, field graphql.CollectedField, obj *model.Response) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
fc := &graphql.FieldContext{
|
||||
Object: "Response",
|
||||
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.Message, 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_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
@@ -3076,33 +3026,6 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr
|
||||
return out
|
||||
}
|
||||
|
||||
var responseImplementors = []string{"Response"}
|
||||
|
||||
func (ec *executionContext) _Response(ctx context.Context, sel ast.SelectionSet, obj *model.Response) graphql.Marshaler {
|
||||
fields := graphql.CollectFields(ec.OperationContext, sel, responseImplementors)
|
||||
|
||||
out := graphql.NewFieldSet(fields)
|
||||
var invalids uint32
|
||||
for i, field := range fields {
|
||||
switch field.Name {
|
||||
case "__typename":
|
||||
out.Values[i] = graphql.MarshalString("Response")
|
||||
case "message":
|
||||
out.Values[i] = ec._Response_message(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 userImplementors = []string{"User"}
|
||||
|
||||
func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler {
|
||||
@@ -3506,20 +3429,6 @@ func (ec *executionContext) marshalNLoginResponse2ᚖgithubᚗcomᚋyauthdevᚋy
|
||||
return ec._LoginResponse(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNResponse2githubᚗcomᚋyauthdevᚋyauthᚋserverᚋgraphᚋmodelᚐResponse(ctx context.Context, sel ast.SelectionSet, v model.Response) graphql.Marshaler {
|
||||
return ec._Response(ctx, sel, &v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNResponse2ᚖgithubᚗcomᚋyauthdevᚋyauthᚋserverᚋgraphᚋmodelᚐResponse(ctx context.Context, sel ast.SelectionSet, v *model.Response) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
return ec._Response(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) {
|
||||
res, err := graphql.UnmarshalString(v)
|
||||
return res, graphql.ErrorOnPath(ctx, err)
|
||||
|
Reference in New Issue
Block a user