QueryClient queries the client edge of a OAuthGrant.
(og *OAuthGrant)
| 1975 | |
| 1976 | // QueryClient queries the client edge of a OAuthGrant. |
| 1977 | func (c *OAuthGrantClient) QueryClient(og *OAuthGrant) *OAuthClientQuery { |
| 1978 | query := (&OAuthClientClient{config: c.config}).Query() |
| 1979 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1980 | id := og.ID |
| 1981 | step := sqlgraph.NewStep( |
| 1982 | sqlgraph.From(oauthgrant.Table, oauthgrant.FieldID, id), |
| 1983 | sqlgraph.To(oauthclient.Table, oauthclient.FieldID), |
| 1984 | sqlgraph.Edge(sqlgraph.M2O, true, oauthgrant.ClientTable, oauthgrant.ClientColumn), |
| 1985 | ) |
| 1986 | fromV = sqlgraph.Neighbors(og.driver.Dialect(), step) |
| 1987 | return fromV, nil |
| 1988 | } |
| 1989 | return query |
| 1990 | } |
| 1991 | |
| 1992 | // Hooks returns the client hooks. |
| 1993 | func (c *OAuthGrantClient) Hooks() []Hook { |