graph/ent: add node template and codegen

Summary:
This change allows to call `Client.Node` to get node info.

```
node, err := client.Node(ctx, id)
```

Reviewed By: dlvhdr

Differential Revision: D17341682

fbshipit-source-id: bed1fe018cca7f5048a624b50b1f5cc6cc3507f3
This commit is contained in:
Ariel Mashraki
2019-09-12 02:49:23 -07:00
committed by Facebook Github Bot
parent 5c9c99f5db
commit 651dc25dd1

View File

@@ -83,7 +83,7 @@ type Edge struct {
var (
once sync.Once
types []string
typeNodes = make(map[string]func(ctx context.Context, id {{ $.IDType }})(*Node, error))
typeNodes = make(map[string]func(context.Context, {{ $.IDType }})(*Node, error))
)
func (c *Client) Node(ctx context.Context, id {{ $.IDType }}) (*Node, error) {