github.com/weaviate/weaviate@v1.24.6/test/acceptance/graphql_resolvers/network_aggregate_test.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package test
    13  
    14  // import (
    15  // 	"encoding/json"
    16  // 	"testing"
    17  
    18  // 	"github.com/weaviate/weaviate/test/helper"
    19  // 	"github.com/stretchr/testify/assert"
    20  // )
    21  
    22  // func TestNetworkAggregate(t *testing.T) {
    23  // 	result := AssertGraphQL(t, helper.RootAuth, `
    24  // 		{
    25  // 			Network {
    26  // 				Aggregate{
    27  // 					RemoteWeaviateForAcceptanceTest {
    28  // 						Things {
    29  // 							Instruments(groupBy:["name"]) {
    30  // 								volume {
    31  // 									count
    32  // 								}
    33  // 							}
    34  // 						}
    35  // 					}
    36  // 				}
    37  // 			}
    38  // 		}
    39  // 	`)
    40  
    41  // 	volume := result.Get("Network", "Aggregate", "RemoteWeaviateForAcceptanceTest", "Things", "Instruments").Result
    42  // 	expected := []interface{}{
    43  // 		map[string]interface{}{
    44  // 			"volume": map[string]interface{}{
    45  // 				"count": json.Number("82"),
    46  // 			},
    47  // 		},
    48  // 	}
    49  
    50  // 	assert.Equal(t, expected, volume)
    51  // }