Fixed mock graphql schemas

This commit is contained in:
Dhiraj Bokde 2023-09-07 10:28:37 -07:00
parent ba454ccd6d
commit a24e1ba733
9 changed files with 5611 additions and 197 deletions

View File

@ -0,0 +1,175 @@
type Artifact {
id: ID
typeId: ID!
uri: String!
state: Int!
name: String!
externalId: String
createTimeSinceEpoch: Int!
lastUpdateTimeSinceEpoch: Int!
type(filter: InstanceFilter): ArtifactType!
properties : [ArtifactProperty!]
}
type ArtifactProperty {
artifactId: ID
name: String
isCustomProperty: Boolean!
propertyValue: Value!
}
type Context {
id: ID
typeId: ID!
name: String!
externalId: String
createTimeSinceEpoch: Int!
lastUpdateTimeSinceEpoch: Int!
type: ContextType!
parent: Context
children: [Context]
attributions: [Artifact!]
associations: [Execution!]
properties: [ContextProperty!]
}
type ContextProperty {
contextId: ID
name: String!
isCustomProperty: Int!
propertyValue: Value!
}
type Event {
id: ID
artifactId: ID!
executionId: ID!
type: Int!
artifact: Artifact
execution: Execution
millisecondsSinceEpoch: Int!
}
type EventPath {
eventId: ID!
isIndexStep: Int!
stepIndex: Int!
stepKey: String!
}
type Execution {
id: ID
typeId: ID!
lastKnownState: Int!
name: String!
externalId: String
createTimeSinceEpoch: Int!
lastUpdateTimeSinceEpoch: Int!
type: ExecutionType!
properties: [ExecutionProperty!]
}
type ExecutionProperty {
executionId: ID
name: String!
isCustomProperty: Int!
propertyValue: Value!
}
union Value = IntValue | DoubleValue | StringValue | BoolValue
type IntValue {
value: Int!
}
type DoubleValue {
value: Float!
}
type StringValue {
value: String!
}
type BoolValue {
value: Boolean!
}
interface Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type TypeProperty {
typeId: ID!
name: String!
dataType: Int!
}
interface ArtifactTypeInterface implements Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type ArtifactType implements ArtifactTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
interface ContextTypeInterface implements Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type ContextType implements ContextTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
interface ExecutionTypeInterface implements Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}
type ExecutionType implements ExecutionTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}

View File

@ -0,0 +1,99 @@
type MlmdDataset implements ArtifactTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type MlmdModel implements ArtifactTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type MlmdMetrics implements ArtifactTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type MlmdStatistics implements ArtifactTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type MlmdTrain implements ExecutionTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}
type MlmdTransform implements ExecutionTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}
type MlmdProcess implements ExecutionTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}
type MlmdEvaluate implements ExecutionTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}
type MlmdDeploy implements ExecutionTypeInterface & Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}

View File

@ -1,147 +1,3 @@
type Artifact {
id: ID
typeId: ID!
uri: String!
state: Int!
name: String!
externalId: String
createTimeSinceEpoch: Int!
lastUpdateTimeSinceEpoch: Int!
type: ArtifactType!
properties : [ArtifactProperty!]
}
type ArtifactProperty {
artifactId: ID
name: String
isCustomProperty: Boolean!
propertyValue: Value!
}
type Context {
id: ID
typeId: ID!
name: String!
externalId: String
createTimeSinceEpoch: Int!
lastUpdateTimeSinceEpoch: Int!
type: ContextType!
parent: Context
children: [Context]
attributions: [Artifact!]
associations: [Execution!]
properties: [ContextProperty!]
}
type ContextProperty {
contextId: ID
name: String!
isCustomProperty: Int!
propertyValue: Value!
}
type Event {
id: ID
artifactId: ID!
executionId: ID!
type: Int!
artifact: Artifact
execution: Execution
millisecondsSinceEpoch: Int!
}
type EventPath {
eventId: ID!
isIndexStep: Int!
stepIndex: Int!
stepKey: String!
}
type Execution {
id: ID
typeId: ID!
lastKnownState: Int!
name: String!
externalId: String
createTimeSinceEpoch: Int!
lastUpdateTimeSinceEpoch: Int!
type: ExecutionType!
properties: [ExecutionProperty!]
}
type ExecutionProperty {
executionId: ID
name: String!
isCustomProperty: Int!
propertyValue: Value!
}
union Value = IntValue | DoubleValue | StringValue | BoolValue
type IntValue {
value: Int!
}
type DoubleValue {
value: Float!
}
type StringValue {
value: String!
}
type BoolValue {
value: Boolean!
}
interface Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type TypeProperty {
typeId: ID!
name: String!
dataType: Int!
}
type ArtifactType implements Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type ContextType implements Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
properties: [TypeProperty!]
}
type ExecutionType implements Type {
id: ID
name: String!
version: String!
typeKind: Int!
description: String!
externalId: String
inputType: String!
outputType: String!
properties: [TypeProperty!]
}
input TypeFilter {
ids: [ID!]
names: [String!]
@ -165,4 +21,5 @@ type Query {
contexts(filter: InstanceFilter): [Context!]
executions(filter: InstanceFilter): [Execution!]
events: [Event!]
mlmdDataset(filter: InstanceFilter): [MlmdDataset!]
}

View File

@ -1,27 +0,0 @@
# types for ml-metadata library
artifact-types:
- name: "mlflow.Model"
- name: "mlflow.ModelEvaluation"
- name: "mlflow.EvaluationMeasure"
- name: "mlflow.EvaluationSpecification"
- name: "mlflow.EvaluationProcedure"
- name: "mlflow.Task"
- name: "mlflow.Data"
- name: "mlflow.DataSet"
- name: "mlflow.Feature"
- name: "mlflow.Algorithm"
- name: "mlflow.Software"
- name: "mlflow.Implementation"
- name: "mlflow.HyperParameter"
- name: "mlflow.HyperParameterSetting"
- name: "mlflow.ImplementationCharacteristic"
- name: "mlflow.DatasetCharacteristic"
- name: "mlflow.FeatureCharacteristic"
context-types:
- name: "mlflow.RegisteredModel"
- name: "mlflow.ModelVersion"
- name: "mlflow.DataCharacteristic"
execution-types:
- name: "mlflow.Study"
- name: "mlflow.Experiment"
- name: "mlflow.Run"

View File

@ -0,0 +1,27 @@
# types for ml-metadata library
artifact-types:
- name: "mlschema.Model"
- name: "mlschema.ModelEvaluation"
- name: "mlschema.EvaluationMeasure"
- name: "mlschema.EvaluationSpecification"
- name: "mlschema.EvaluationProcedure"
- name: "mlschema.Task"
- name: "mlschema.Data"
- name: "mlschema.DataSet"
- name: "mlschema.Feature"
- name: "mlschema.Algorithm"
- name: "mlschema.Software"
- name: "mlschema.Implementation"
- name: "mlschema.HyperParameter"
- name: "mlschema.HyperParameterSetting"
- name: "mlschema.ImplementationCharacteristic"
- name: "mlschema.DatasetCharacteristic"
- name: "mlschema.FeatureCharacteristic"
context-types:
- name: "mlschema.RegisteredModel"
- name: "mlschema.ModelVersion"
- name: "mlschema.DataCharacteristic"
execution-types:
- name: "mlschema.Study"
- name: "mlschema.Experiment"
- name: "mlschema.Run"

View File

@ -2,6 +2,44 @@
package graph
type ArtifactTypeInterface interface {
IsType()
IsArtifactTypeInterface()
GetID() *string
GetName() string
GetVersion() string
GetTypeKind() int
GetDescription() string
GetExternalID() *string
GetProperties() []*TypeProperty
}
type ContextTypeInterface interface {
IsType()
IsContextTypeInterface()
GetID() *string
GetName() string
GetVersion() string
GetTypeKind() int
GetDescription() string
GetExternalID() *string
GetProperties() []*TypeProperty
}
type ExecutionTypeInterface interface {
IsType()
IsExecutionTypeInterface()
GetID() *string
GetName() string
GetVersion() string
GetTypeKind() int
GetDescription() string
GetExternalID() *string
GetInputType() string
GetOutputType() string
GetProperties() []*TypeProperty
}
type Type interface {
IsType()
GetID() *string
@ -47,7 +85,7 @@ type ArtifactType struct {
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (ArtifactType) IsType() {}
func (ArtifactType) IsArtifactTypeInterface() {}
func (this ArtifactType) GetID() *string { return this.ID }
func (this ArtifactType) GetName() string { return this.Name }
func (this ArtifactType) GetVersion() string { return this.Version }
@ -65,6 +103,8 @@ func (this ArtifactType) GetProperties() []*TypeProperty {
return interfaceSlice
}
func (ArtifactType) IsType() {}
type BoolValue struct {
Value bool `json:"value"`
}
@ -103,7 +143,7 @@ type ContextType struct {
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (ContextType) IsType() {}
func (ContextType) IsContextTypeInterface() {}
func (this ContextType) GetID() *string { return this.ID }
func (this ContextType) GetName() string { return this.Name }
func (this ContextType) GetVersion() string { return this.Version }
@ -121,6 +161,8 @@ func (this ContextType) GetProperties() []*TypeProperty {
return interfaceSlice
}
func (ContextType) IsType() {}
type DoubleValue struct {
Value float64 `json:"value"`
}
@ -175,13 +217,15 @@ type ExecutionType struct {
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (ExecutionType) IsType() {}
func (ExecutionType) IsExecutionTypeInterface() {}
func (this ExecutionType) GetID() *string { return this.ID }
func (this ExecutionType) GetName() string { return this.Name }
func (this ExecutionType) GetVersion() string { return this.Version }
func (this ExecutionType) GetTypeKind() int { return this.TypeKind }
func (this ExecutionType) GetDescription() string { return this.Description }
func (this ExecutionType) GetExternalID() *string { return this.ExternalID }
func (this ExecutionType) GetInputType() string { return this.InputType }
func (this ExecutionType) GetOutputType() string { return this.OutputType }
func (this ExecutionType) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
@ -193,6 +237,8 @@ func (this ExecutionType) GetProperties() []*TypeProperty {
return interfaceSlice
}
func (ExecutionType) IsType() {}
type InstanceFilter struct {
Ids []string `json:"ids,omitempty"`
TypeIds []string `json:"typeIds,omitempty"`
@ -206,6 +252,296 @@ type IntValue struct {
func (IntValue) IsValue() {}
type MlmdDataset struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdDataset) IsArtifactTypeInterface() {}
func (this MlmdDataset) GetID() *string { return this.ID }
func (this MlmdDataset) GetName() string { return this.Name }
func (this MlmdDataset) GetVersion() string { return this.Version }
func (this MlmdDataset) GetTypeKind() int { return this.TypeKind }
func (this MlmdDataset) GetDescription() string { return this.Description }
func (this MlmdDataset) GetExternalID() *string { return this.ExternalID }
func (this MlmdDataset) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdDataset) IsType() {}
type MlmdDeploy struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
InputType string `json:"inputType"`
OutputType string `json:"outputType"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdDeploy) IsExecutionTypeInterface() {}
func (this MlmdDeploy) GetID() *string { return this.ID }
func (this MlmdDeploy) GetName() string { return this.Name }
func (this MlmdDeploy) GetVersion() string { return this.Version }
func (this MlmdDeploy) GetTypeKind() int { return this.TypeKind }
func (this MlmdDeploy) GetDescription() string { return this.Description }
func (this MlmdDeploy) GetExternalID() *string { return this.ExternalID }
func (this MlmdDeploy) GetInputType() string { return this.InputType }
func (this MlmdDeploy) GetOutputType() string { return this.OutputType }
func (this MlmdDeploy) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdDeploy) IsType() {}
type MlmdEvaluate struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
InputType string `json:"inputType"`
OutputType string `json:"outputType"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdEvaluate) IsExecutionTypeInterface() {}
func (this MlmdEvaluate) GetID() *string { return this.ID }
func (this MlmdEvaluate) GetName() string { return this.Name }
func (this MlmdEvaluate) GetVersion() string { return this.Version }
func (this MlmdEvaluate) GetTypeKind() int { return this.TypeKind }
func (this MlmdEvaluate) GetDescription() string { return this.Description }
func (this MlmdEvaluate) GetExternalID() *string { return this.ExternalID }
func (this MlmdEvaluate) GetInputType() string { return this.InputType }
func (this MlmdEvaluate) GetOutputType() string { return this.OutputType }
func (this MlmdEvaluate) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdEvaluate) IsType() {}
type MlmdMetrics struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdMetrics) IsArtifactTypeInterface() {}
func (this MlmdMetrics) GetID() *string { return this.ID }
func (this MlmdMetrics) GetName() string { return this.Name }
func (this MlmdMetrics) GetVersion() string { return this.Version }
func (this MlmdMetrics) GetTypeKind() int { return this.TypeKind }
func (this MlmdMetrics) GetDescription() string { return this.Description }
func (this MlmdMetrics) GetExternalID() *string { return this.ExternalID }
func (this MlmdMetrics) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdMetrics) IsType() {}
type MlmdModel struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdModel) IsArtifactTypeInterface() {}
func (this MlmdModel) GetID() *string { return this.ID }
func (this MlmdModel) GetName() string { return this.Name }
func (this MlmdModel) GetVersion() string { return this.Version }
func (this MlmdModel) GetTypeKind() int { return this.TypeKind }
func (this MlmdModel) GetDescription() string { return this.Description }
func (this MlmdModel) GetExternalID() *string { return this.ExternalID }
func (this MlmdModel) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdModel) IsType() {}
type MlmdProcess struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
InputType string `json:"inputType"`
OutputType string `json:"outputType"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdProcess) IsExecutionTypeInterface() {}
func (this MlmdProcess) GetID() *string { return this.ID }
func (this MlmdProcess) GetName() string { return this.Name }
func (this MlmdProcess) GetVersion() string { return this.Version }
func (this MlmdProcess) GetTypeKind() int { return this.TypeKind }
func (this MlmdProcess) GetDescription() string { return this.Description }
func (this MlmdProcess) GetExternalID() *string { return this.ExternalID }
func (this MlmdProcess) GetInputType() string { return this.InputType }
func (this MlmdProcess) GetOutputType() string { return this.OutputType }
func (this MlmdProcess) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdProcess) IsType() {}
type MlmdStatistics struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdStatistics) IsArtifactTypeInterface() {}
func (this MlmdStatistics) GetID() *string { return this.ID }
func (this MlmdStatistics) GetName() string { return this.Name }
func (this MlmdStatistics) GetVersion() string { return this.Version }
func (this MlmdStatistics) GetTypeKind() int { return this.TypeKind }
func (this MlmdStatistics) GetDescription() string { return this.Description }
func (this MlmdStatistics) GetExternalID() *string { return this.ExternalID }
func (this MlmdStatistics) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdStatistics) IsType() {}
type MlmdTrain struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
InputType string `json:"inputType"`
OutputType string `json:"outputType"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdTrain) IsExecutionTypeInterface() {}
func (this MlmdTrain) GetID() *string { return this.ID }
func (this MlmdTrain) GetName() string { return this.Name }
func (this MlmdTrain) GetVersion() string { return this.Version }
func (this MlmdTrain) GetTypeKind() int { return this.TypeKind }
func (this MlmdTrain) GetDescription() string { return this.Description }
func (this MlmdTrain) GetExternalID() *string { return this.ExternalID }
func (this MlmdTrain) GetInputType() string { return this.InputType }
func (this MlmdTrain) GetOutputType() string { return this.OutputType }
func (this MlmdTrain) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdTrain) IsType() {}
type MlmdTransform struct {
ID *string `json:"id,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
TypeKind int `json:"typeKind"`
Description string `json:"description"`
ExternalID *string `json:"externalId,omitempty"`
InputType string `json:"inputType"`
OutputType string `json:"outputType"`
Properties []*TypeProperty `json:"properties,omitempty"`
}
func (MlmdTransform) IsExecutionTypeInterface() {}
func (this MlmdTransform) GetID() *string { return this.ID }
func (this MlmdTransform) GetName() string { return this.Name }
func (this MlmdTransform) GetVersion() string { return this.Version }
func (this MlmdTransform) GetTypeKind() int { return this.TypeKind }
func (this MlmdTransform) GetDescription() string { return this.Description }
func (this MlmdTransform) GetExternalID() *string { return this.ExternalID }
func (this MlmdTransform) GetInputType() string { return this.InputType }
func (this MlmdTransform) GetOutputType() string { return this.OutputType }
func (this MlmdTransform) GetProperties() []*TypeProperty {
if this.Properties == nil {
return nil
}
interfaceSlice := make([]*TypeProperty, 0, len(this.Properties))
for _, concrete := range this.Properties {
interfaceSlice = append(interfaceSlice, concrete)
}
return interfaceSlice
}
func (MlmdTransform) IsType() {}
type StringValue struct {
Value string `json:"value"`
}

View File

@ -0,0 +1,22 @@
package graph
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen version v0.17.36
import (
"context"
"github.com/dhirajsb/ml-metadata-go-server/model/graph"
)
// Type is the resolver for the type field.
func (r *artifactResolver) Type(ctx context.Context, obj *graph.Artifact, filter *graph.InstanceFilter) (*graph.ArtifactType, error) {
id := "1"
return &graph.ArtifactType{ID: &id, Name: "TestType"}, nil
}
// Artifact returns ArtifactResolver implementation.
func (r *Resolver) Artifact() ArtifactResolver { return &artifactResolver{r} }
type artifactResolver struct{ *Resolver }

File diff suppressed because it is too large Load Diff

View File

@ -11,12 +11,6 @@ import (
"github.com/dhirajsb/ml-metadata-go-server/model/graph"
)
// Type is the resolver for the type field.
func (r *artifactResolver) Type(ctx context.Context, obj *graph.Artifact) (*graph.ArtifactType, error) {
id := "1"
return &graph.ArtifactType{ID: &id, Name: "TestType"}, nil
}
// Types is the resolver for the types field.
func (r *queryResolver) Types(ctx context.Context, filter *graph.TypeFilter) ([]graph.Type, error) {
//panic(fmt.Errorf("not implemented: Types - types"))
@ -60,11 +54,12 @@ func (r *queryResolver) Events(ctx context.Context) ([]*graph.Event, error) {
panic(fmt.Errorf("not implemented: Events - events"))
}
// Artifact returns ArtifactResolver implementation.
func (r *Resolver) Artifact() ArtifactResolver { return &artifactResolver{r} }
// MlmdDataset is the resolver for the mlmdDataset field.
func (r *queryResolver) MlmdDataset(ctx context.Context, filter *graph.InstanceFilter) ([]*graph.MlmdDataset, error) {
panic(fmt.Errorf("not implemented: MlmdDataset - mlmdDataset"))
}
// Query returns QueryResolver implementation.
func (r *Resolver) Query() QueryResolver { return &queryResolver{r} }
type artifactResolver struct{ *Resolver }
type queryResolver struct{ *Resolver }