-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook.resolvers.go
26 lines (19 loc) · 975 Bytes
/
book.resolvers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package bookcatalog
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen version v0.17.35
import (
"context"
"github.com/pratikjagrut/book-catalog/ent"
)
// CreateAuthor is the resolver for the createAuthor field.
func (r *mutationResolver) CreateAuthor(ctx context.Context, input ent.CreateAuthorInput) (*ent.Author, error) {
return r.client.Author.Create().SetInput(input).Save(ctx)
}
// CreateBook is the resolver for the createBook field.
func (r *mutationResolver) CreateBook(ctx context.Context, input ent.CreateBookInput) (*ent.Book, error) {
return r.client.Book.Create().SetInput(input).Save(ctx)
}
// Mutation returns MutationResolver implementation.
func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} }
type mutationResolver struct{ *Resolver }