newGraphQLEncoder returns a ready to use graphQLEncoder, given the context and a base encoder
(ctx context.Context, enc *encoder)
| 69 | |
| 70 | // newGraphQLEncoder returns a ready to use graphQLEncoder, given the context and a base encoder |
| 71 | func newGraphQLEncoder(ctx context.Context, enc *encoder) *graphQLEncoder { |
| 72 | return &graphQLEncoder{ |
| 73 | encoder: enc, |
| 74 | ctx: ctx, |
| 75 | typeAttrId: enc.idForAttr("dgraph.type"), |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | // encode creates a JSON encoded GraphQL response. |
| 80 | func (genc *graphQLEncoder) encode(encInp encodeInput) bool { |