ToSubGraph converts the GraphQuery into the pb.SubGraph instance type.
(ctx context.Context, gq *dql.GraphQuery)
| 757 | |
| 758 | // ToSubGraph converts the GraphQuery into the pb.SubGraph instance type. |
| 759 | func ToSubGraph(ctx context.Context, gq *dql.GraphQuery) (*SubGraph, error) { |
| 760 | sg, err := newGraph(ctx, gq) |
| 761 | if err != nil { |
| 762 | return nil, err |
| 763 | } |
| 764 | err = treeCopy(gq, sg) |
| 765 | if err != nil { |
| 766 | return nil, err |
| 767 | } |
| 768 | return sg, err |
| 769 | } |
| 770 | |
| 771 | // ContextKey is used to set options in the context object. |
| 772 | type ContextKey int |
no test coverage detected