Skip to content

Instantly share code, notes, and snippets.

@manakuro
Created December 10, 2021 05:05
Show Gist options
  • Save manakuro/11e84f923b0a50efacd6a2b4f88b7dde to your computer and use it in GitHub Desktop.
Save manakuro/11e84f923b0a50efacd6a2b4f88b7dde to your computer and use it in GitHub Desktop.
func (r *userRepository) List(ctx context.Context, after *model.Cursor, first *int, before *model.Cursor, last *int, where *model.UserWhereInput) (*model.UserConnection, error) {
us, err := r.client.
User.
Query().
Paginate(ctx, after, first, before, last, ent.WithUserFilter(where.Filter))
if err != nil {
return nil, err
}
return us, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment