QueryGrants queries the grants edge of a OAuthClient.
(oc *OAuthClient)
| 1808 | |
| 1809 | // QueryGrants queries the grants edge of a OAuthClient. |
| 1810 | func (c *OAuthClientClient) QueryGrants(oc *OAuthClient) *OAuthGrantQuery { |
| 1811 | query := (&OAuthGrantClient{config: c.config}).Query() |
| 1812 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1813 | id := oc.ID |
| 1814 | step := sqlgraph.NewStep( |
| 1815 | sqlgraph.From(oauthclient.Table, oauthclient.FieldID, id), |
| 1816 | sqlgraph.To(oauthgrant.Table, oauthgrant.FieldID), |
| 1817 | sqlgraph.Edge(sqlgraph.O2M, false, oauthclient.GrantsTable, oauthclient.GrantsColumn), |
| 1818 | ) |
| 1819 | fromV = sqlgraph.Neighbors(oc.driver.Dialect(), step) |
| 1820 | return fromV, nil |
| 1821 | } |
| 1822 | return query |
| 1823 | } |
| 1824 | |
| 1825 | // Hooks returns the client hooks. |
| 1826 | func (c *OAuthClientClient) Hooks() []Hook { |