Documentation ¶
Overview ¶
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
Index ¶
- Variables
- 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)
- 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 ¶
var CarSchema = schema.Schema{ Things: &models.SemanticSchema{ Classes: []*models.SemanticSchemaClass{ &models.SemanticSchemaClass{ Class: "Manufacturer", Properties: []*models.SemanticSchemaClassProperty{ &models.SemanticSchemaClassProperty{ Name: "name", AtDataType: []string{"string"}, }, }, }, &models.SemanticSchemaClass{ Class: "Car", Properties: []*models.SemanticSchemaClassProperty{ &models.SemanticSchemaClassProperty{ Name: "horsepower", AtDataType: []string{"int"}, }, &models.SemanticSchemaClassProperty{ Name: "weight", AtDataType: []string{"number"}, }, &models.SemanticSchemaClassProperty{ Name: "modelName", AtDataType: []string{"string"}, }, &models.SemanticSchemaClassProperty{ Name: "madeBy", AtDataType: []string{"Manufacturer"}, }, &models.SemanticSchemaClassProperty{ Name: "startOfProduction", AtDataType: []string{"date"}, }, &models.SemanticSchemaClassProperty{ Name: "stillInProduction", AtDataType: []string{"boolean"}, }, }, }, }, }, Actions: &models.SemanticSchema{ Classes: []*models.SemanticSchemaClass{}, }, }
CarSchema contains a car which has every primtive field and a ref field there is
var SimpleSchema = schema.Schema{ Things: &models.SemanticSchema{ Classes: []*models.SemanticSchemaClass{ &models.SemanticSchemaClass{ Class: "SomeThing", Properties: []*models.SemanticSchemaClassProperty{ &models.SemanticSchemaClassProperty{ Name: "NetworkRefField", AtDataType: []string{"OtherInstance/SomeRemoteClass"}, }, }, }, }, }, Actions: &models.SemanticSchema{ Classes: []*models.SemanticSchemaClass{ &models.SemanticSchemaClass{ Class: "SomeAction", Properties: []*models.SemanticSchemaClassProperty{ &models.SemanticSchemaClassProperty{ Name: "intField", AtDataType: []string{"int"}, }, &models.SemanticSchemaClassProperty{ Name: "location", AtDataType: []string{"geoCoordinates"}, }, &models.SemanticSchemaClassProperty{ Name: "hasAction", AtDataType: []string{"SomeAction"}, }, &models.SemanticSchemaClassProperty{ Name: "hasActions", AtDataType: []string{"SomeAction"}, Cardinality: &many, }, }, }, }, }, }
Functions ¶
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)
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