Documentation ¶
Index ¶
- func ExtractWhereClause(args []*ast.Argument, store utils.M) (map[string]interface{}, error)
- func Filter(field *ast.Field, value interface{}) interface{}
- type AuthInterface
- type CrudInterface
- type FunctionInterface
- type Module
- func (graph *Module) ExecGraphQLQuery(ctx context.Context, req *model.GraphQLRequest, token string, ...)
- func (graph *Module) GetDBAlias(ctx context.Context, field *ast.Field, token string, store utils.M) (string, error)
- func (graph *Module) GetProjectID() string
- func (graph *Module) SetConfig(project string)
- func (graph *Module) SetProjectAESKey(aesKey string) error
- type SchemaInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractWhereClause ¶
ExtractWhereClause return the where arg of graphql schema
Types ¶
type AuthInterface ¶
type AuthInterface interface { ParseToken(ctx context.Context, token string) (map[string]interface{}, error) IsCreateOpAuthorised(ctx context.Context, project, dbAlias, col, token string, req *model.CreateRequest) (model.RequestParams, error) IsReadOpAuthorised(ctx context.Context, project, dbAlias, col, token string, req *model.ReadRequest, stub model.ReturnWhereStub) (*model.PostProcess, model.RequestParams, error) IsUpdateOpAuthorised(ctx context.Context, project, dbAlias, col, token string, req *model.UpdateRequest) (model.RequestParams, error) IsDeleteOpAuthorised(ctx context.Context, project, dbAlias, col, token string, req *model.DeleteRequest) (model.RequestParams, error) IsFuncCallAuthorised(ctx context.Context, project, service, function, token string, params interface{}) (*model.PostProcess, model.RequestParams, error) IsPreparedQueryAuthorised(ctx context.Context, project, dbAlias, id, token string, req *model.PreparedQueryRequest) (*model.PostProcess, model.RequestParams, error) }
AuthInterface is an interface consisting of functions of auth module used by graphql module
type CrudInterface ¶
type CrudInterface interface { Create(ctx context.Context, dbAlias, collection string, request *model.CreateRequest, params model.RequestParams) error Read(ctx context.Context, dbAlias, collection string, request *model.ReadRequest, params model.RequestParams) (interface{}, *model.SQLMetaData, error) Update(ctx context.Context, dbAlias, collection string, request *model.UpdateRequest, params model.RequestParams) error Delete(ctx context.Context, dbAlias, collection string, request *model.DeleteRequest, params model.RequestParams) error Batch(ctx context.Context, dbAlias string, req *model.BatchRequest, params model.RequestParams) error GetDBType(dbAlias string) (string, error) IsPreparedQueryPresent(directive, fieldName string) bool ExecPreparedQuery(ctx context.Context, dbAlias, id string, req *model.PreparedQueryRequest, params model.RequestParams) (interface{}, *model.SQLMetaData, error) }
CrudInterface is an interface consisting of functions of crud module used by graphql module
type FunctionInterface ¶
type FunctionInterface interface {
CallWithContext(ctx context.Context, service, function, token string, reqParams model.RequestParams, req *model.FunctionsRequest) (int, interface{}, error)
}
FunctionInterface is an interface consisting of functions of function module used by graphql module
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is the object for the GraphQL module
func New ¶
func New(a AuthInterface, c CrudInterface, f FunctionInterface, s SchemaInterface) *Module
New creates a new GraphQL module
func (*Module) ExecGraphQLQuery ¶
func (graph *Module) ExecGraphQLQuery(ctx context.Context, req *model.GraphQLRequest, token string, cb model.GraphQLCallback)
ExecGraphQLQuery executes the provided graphql query
func (*Module) GetDBAlias ¶
func (graph *Module) GetDBAlias(ctx context.Context, field *ast.Field, token string, store utils.M) (string, error)
GetDBAlias returns the dbAlias of the request
func (*Module) GetProjectID ¶
GetProjectID sets the project configuration
func (*Module) SetProjectAESKey ¶
SetProjectAESKey sets aes key
Click to show internal directories.
Click to hide internal directories.