QueryOauthGrants queries the oauth_grants edge of a User.
(u *User)
| 3057 | |
| 3058 | // QueryOauthGrants queries the oauth_grants edge of a User. |
| 3059 | func (c *UserClient) QueryOauthGrants(u *User) *OAuthGrantQuery { |
| 3060 | query := (&OAuthGrantClient{config: c.config}).Query() |
| 3061 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 3062 | id := u.ID |
| 3063 | step := sqlgraph.NewStep( |
| 3064 | sqlgraph.From(user.Table, user.FieldID, id), |
| 3065 | sqlgraph.To(oauthgrant.Table, oauthgrant.FieldID), |
| 3066 | sqlgraph.Edge(sqlgraph.O2M, false, user.OauthGrantsTable, user.OauthGrantsColumn), |
| 3067 | ) |
| 3068 | fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) |
| 3069 | return fromV, nil |
| 3070 | } |
| 3071 | return query |
| 3072 | } |
| 3073 | |
| 3074 | // Hooks returns the client hooks. |
| 3075 | func (c *UserClient) Hooks() []Hook { |