Build stores resolvable into d, and then resolves and returns the resolved object.
(ctx context.Context, r Resolvable)
| 53 | // Build stores resolvable into d, and then resolves and returns the resolved |
| 54 | // object. |
| 55 | func Build(ctx context.Context, r Resolvable) (interface{}, error) { |
| 56 | id, err := Store(ctx, r) |
| 57 | if err != nil { |
| 58 | return nil, err |
| 59 | } |
| 60 | return Get(ctx).Resolve(ctx, id) |
| 61 | } |
| 62 | |
| 63 | // GetOrBuild stores resolvable into d, if the object is already resolved |
| 64 | // in the database, returns it. Otherwise it schdules the resource to be build |