Exemplo n.º 1
0
//export processEndVisitField
func processEndVisitField(node *C.struct_GraphQLAstField, parser unsafe.Pointer) {
	p := (*Parser)(parser)
	field := p.nodes.Head().(*graphql.Selection)
	if field.Field != nil {
		alias := C.GraphQLAstField_get_alias(node)
		if alias != nil {
			field.Field.Alias = C.GoString(C.GraphQLAstName_get_value(alias))
		}
		name := C.GraphQLAstField_get_name(node)
		if name != nil {
			field.Field.Name = C.GoString(C.GraphQLAstName_get_value(name))
		}
		p.endVisitNode()
	}
}
Exemplo n.º 2
0
//export printField
func printField(field *C.struct_GraphQLAstField, unused unsafe.Pointer) int {
	fmt.Printf("field : %s\n", C.GoString(C.GraphQLAstName_get_value(C.GraphQLAstField_get_name(field))))
	return 0
}