99designs / 99designs/gqlgen

How can I avoid gqlgen always generate extra reslover that i dont need

Ouverte
#2,623 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
10.8k
Forks
1.3k
Merge moyen
2 j 36 min
PR mergées (30 j)
26

Description

### What happened?
when i define a graphl gen with "scalar time" type , it will generate an extra reslover to me
```
scalar Time

type User {
id: ID!
firstname: String!
lastname: String!
email: String!
hashedPassword: String!
birthday: Time!
}
```

it generate an "birthday" reslover , that i don't want
```
// CreateUser is the resolver for the createUser field.
func (r *mutationResolver) CreateUser(ctx context.Context, input schema.CreateUserInput) (*model.User, error) {
panic(fmt.Errorf("not implemented: CreateUser - createUser"))
}

// Birthday is the resolver for the birthday field.
func (r *createUserInputResolver) Birthday(ctx context.Context, obj *schema.CreateUserInput, data *time.Time) error {
panic(fmt.Errorf("not implemented: Birthday - birthday"))
}
```

when i try to use gqlgen.yaml configure a self defined models
```
models:
ReqPdConfig:
model:
- shihansin/server/db/syncworker.ReqPdConfig
```
ReqPdConfig is a struct include multiple struct , but itself is a whole big struct , but it generate many resolver to me
```
func (r *reqPdConfigResolver) AwardConfig(ctx context.Context, obj *syncworker.ReqPdConfig, data []*graphql1.AwardInput) error {
panic(fmt.Errorf("not implemented: AwardConfig - awardConfig"))
}

// Qa is the resolver for the qa field.
func (r *reqPdConfigResolver) Qa(ctx context.Context, obj *syncworker.ReqPdConfig, data []*graphql1.QAInput) error {
panic(fmt.Errorf("not implemented: Qa - qa"))
}

// HighLight is the resolver for the highLight field.
func (r *reqPdConfigResolver) HighLight(ctx context.Context, obj *syncworker.ReqPdConfig, data []*graphql1.HighlightInput) error {
panic(fmt.Errorf("not implemented: HighLight - highLight"))
}

// AboutProduct is the resolver for the aboutProduct field.
func (r *reqPdConfigResolver) AboutProduct(ctx context.Context, obj *syncworker.ReqPdConfig, data []*graphql1.AboutProductInput) error {
panic(fmt.Errorf("not implemented: AboutProduct - aboutProduct"))
}

// Mutation returns graphql1.MutationResolver implementation.
func (r *Resolver) Mutation() graphql1.MutationResolver { return &mutationResolver{r} }

// ReqPdConfig returns graphql1.ReqPdConfigResolver implementation.
func (r *Resolver) ReqPdConfig() graphql1.ReqPdConfigResolver { return &reqPdConfigResolver{r} }
```

### What did you expect?
how can i avoid it , which is only generate one single reslover , or generate the reslover that i want

### Minimal graphql.schema and models to reproduce

### versions
- `go run github.com/99designs/gqlgen version`?
- lastest version
- `go version`?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.