diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-11 19:46:38 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-11 19:46:38 +0200 |
commit | 7b05983c19af4da70f2a9a5062913f4e4f5d5faa (patch) | |
tree | 006d9b828d249e6a7e3362164308089991c74857 /graphql/graph | |
parent | 9cbd5b4ee113c660377ffe9c01ca374d6addfef4 (diff) | |
download | git-bug-7b05983c19af4da70f2a9a5062913f4e4f5d5faa.tar.gz |
graphql: AllBugs now accept a query
Diffstat (limited to 'graphql/graph')
-rw-r--r-- | graphql/graph/gen_graph.go | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/graphql/graph/gen_graph.go b/graphql/graph/gen_graph.go index 798962e3..a8be6cd3 100644 --- a/graphql/graph/gen_graph.go +++ b/graphql/graph/gen_graph.go @@ -53,7 +53,7 @@ type Resolvers interface { Query_defaultRepository(ctx context.Context) (*models.Repository, error) Query_repository(ctx context.Context, id string) (*models.Repository, error) - Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (models.BugConnection, error) + Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int, query *string) (models.BugConnection, error) Repository_bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) SetStatusOperation_date(ctx context.Context, obj *operations.SetStatusOperation) (time.Time, error) @@ -103,7 +103,7 @@ type QueryResolver interface { Repository(ctx context.Context, id string) (*models.Repository, error) } type RepositoryResolver interface { - AllBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (models.BugConnection, error) + AllBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int, query *string) (models.BugConnection, error) Bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) } type SetStatusOperationResolver interface { @@ -182,8 +182,8 @@ func (s shortMapper) Query_repository(ctx context.Context, id string) (*models.R return s.r.Query().Repository(ctx, id) } -func (s shortMapper) Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int) (models.BugConnection, error) { - return s.r.Repository().AllBugs(ctx, obj, after, before, first, last) +func (s shortMapper) Repository_allBugs(ctx context.Context, obj *models.Repository, after *string, before *string, first *int, last *int, query *string) (models.BugConnection, error) { + return s.r.Repository().AllBugs(ctx, obj, after, before, first, last, query) } func (s shortMapper) Repository_bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) { @@ -2248,6 +2248,21 @@ func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graph } } args["last"] = arg3 + var arg4 *string + if tmp, ok := field.Args["query"]; ok { + var err error + var ptr1 string + if tmp != nil { + ptr1, err = graphql.UnmarshalString(tmp) + arg4 = &ptr1 + } + + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + } + args["query"] = arg4 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Repository", Args: args, @@ -2263,7 +2278,7 @@ func (ec *executionContext) _Repository_allBugs(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(ctx context.Context) (interface{}, error) { - return ec.resolvers.Repository_allBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int)) + return ec.resolvers.Repository_allBugs(ctx, obj, args["after"].(*string), args["before"].(*string), args["first"].(*int), args["last"].(*int), args["query"].(*string)) }) if err != nil { ec.Error(ctx, err) @@ -3457,6 +3472,8 @@ type Repository { first: Int # Returns the last _n_ elements from the list. last: Int + # A query to select and order bugs + query: String ): BugConnection! bug(prefix: String!): Bug } |