Use the graphql package from weaviate-go-client to construct queries via a fluent builder pattern. Initialize the client, then chain methods like Get(), WithNearVector(), and Do() to execute the query.
import (
"github.com/weaviate/weaviate-go-client/v4/weaviate"
"github.com/weaviate/weaviate-go-client/v4/weaviate/graphql"
)
// Assuming wvClient is initialized and vector is available
result, err := wvClient.GraphQL().Get().
WithNearVector(graphql.NearVectorArgBuilder().WithVector(vector)).
WithClassName("Document").
WithFields(graphql.Field{Name: "text"}).
WithLimit(3).
Do(ctx)