Documentation ¶
Index ¶
- Variables
- func CreateSimpleSchema(vectorizer string) schema.Schema
- func EmptyList() interface{}
- func EmptyListThunk() func() interface{}
- func IdentityThunk(x interface{}) func() interface{}
- func NilThunk() func() interface{}
- func SingletonThunk(x interface{}) func() interface{}
- type GraphQLResult
- type MockResolver
- func (mr *MockResolver) AssertErrors(t *testing.T, query string, errors []gqlerrors.FormattedError)
- func (mr *MockResolver) AssertFailToResolve(t *testing.T, query string, errors ...string)
- func (mr *MockResolver) AssertJSONResponse(t *testing.T, query string, expectedResponseString string)
- func (mr *MockResolver) AssertResolve(t *testing.T, query string) *GraphQLResult
- func (mr *MockResolver) Resolve(query string) *graphql.Result
Constants ¶
This section is empty.
Variables ¶
View Source
var CarSchema = schema.Schema{ Objects: &models.Schema{ Classes: []*models.Class{ { Class: "Manufacturer", Properties: []*models.Property{ { Name: "name", DataType: schema.DataTypeText.PropString(), Tokenization: models.PropertyTokenizationWhitespace, }, }, }, { Class: "Car", Properties: []*models.Property{ { Name: "horsepower", DataType: []string{"int"}, }, { Name: "weight", DataType: []string{"number"}, }, { Name: "modelName", DataType: schema.DataTypeText.PropString(), Tokenization: models.PropertyTokenizationWhitespace, }, { Name: "madeBy", DataType: []string{"Manufacturer"}, }, { Name: "startOfProduction", DataType: []string{"date"}, }, { Name: "stillInProduction", DataType: []string{"boolean"}, }, }, }, }, }, }
CarSchema contains a car which has every primitive field and a ref field there is
View Source
var SimpleSchema = CreateSimpleSchema(config.VectorizerModuleText2VecContextionary)
Functions ¶
func CreateSimpleSchema ¶
func EmptyListThunk ¶
func EmptyListThunk() func() interface{}
func IdentityThunk ¶
func IdentityThunk(x interface{}) func() interface{}
func SingletonThunk ¶
func SingletonThunk(x interface{}) func() interface{}
Types ¶
type GraphQLResult ¶
type GraphQLResult struct {
Result interface{}
}
func (GraphQLResult) Get ¶
func (g GraphQLResult) Get(paths ...string) *GraphQLResult
Drill down in the result
type MockResolver ¶
type MockResolver struct { mock.Mock Schema *schema.Schema RootField *graphql.Field RootFieldName string RootObject map[string]interface{} }
func (*MockResolver) AssertErrors ¶
func (mr *MockResolver) AssertErrors(t *testing.T, query string, errors []gqlerrors.FormattedError)
func (*MockResolver) AssertFailToResolve ¶
func (mr *MockResolver) AssertFailToResolve(t *testing.T, query string, errors ...string)
func (*MockResolver) AssertJSONResponse ¶
func (mr *MockResolver) AssertJSONResponse(t *testing.T, query string, expectedResponseString string)
func (*MockResolver) AssertResolve ¶
func (mr *MockResolver) AssertResolve(t *testing.T, query string) *GraphQLResult
Click to show internal directories.
Click to hide internal directories.