diff --git a/.editorconfig b/.editorconfig index e9b10f544c..167e5eb52b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -24,3 +24,7 @@ indent_size = 2 [*.proto] indent_style = space indent_size = 2 + +[*.graphql] +indent_style = space +indent_size = 2 diff --git a/backend/apid/graphql/generator/types.go b/backend/apid/graphql/generator/types.go index 4c5bb9a606..3ccee9b351 100644 --- a/backend/apid/graphql/generator/types.go +++ b/backend/apid/graphql/generator/types.go @@ -22,15 +22,14 @@ func genOutputTypeReference(t ast.Type) *jen.Statement { } func genTypeReference(t ast.Type, expectedType string) *jen.Statement { - var wrapperType ast.Type var namedType *ast.Named switch ttype := t.(type) { case *ast.List: - wrapperType = ttype - namedType = ttype.Type.(*ast.Named) + s := genTypeReference(ttype.Type, expectedType) + return jen.Qual(graphqlPkg, "NewList").Call(s) case *ast.NonNull: - wrapperType = t - namedType = ttype.Type.(*ast.Named) + s := genTypeReference(ttype.Type, expectedType) + return jen.Qual(graphqlPkg, "NewNonNull").Call(s) case *ast.Named: namedType = ttype default: @@ -54,10 +53,5 @@ func genTypeReference(t ast.Type, expectedType string) *jen.Statement { valueStatement = jen.Qual(utilPkg, expectedType).Call(jen.Lit(name)) } - if _, ok := wrapperType.(*ast.NonNull); ok { - return jen.Qual(graphqlPkg, "NewNonNull").Call(valueStatement) - } else if _, ok := wrapperType.(*ast.List); ok { - return jen.Qual(graphqlPkg, "NewList").Call(valueStatement) - } return valueStatement } diff --git a/backend/apid/graphql/schema/mutations.gql.go b/backend/apid/graphql/schema/mutations.gql.go new file mode 100644 index 0000000000..57333175cf --- /dev/null +++ b/backend/apid/graphql/schema/mutations.gql.go @@ -0,0 +1,237 @@ +// Code generated by graphql/generator package. DO NOT EDIT. + +package schema + +import ( + context "context" + graphql "github.com/graphql-go/graphql" + util "github.com/sensu/sensu-go/backend/apid/graphql/generator/util" +) + +// +// MutationResolver represents a collection of methods whose products represent the +// response values of the 'Mutation' type. +// +// == Example SDL +// +// """ +// Dog's are not hooman. +// """ +// type Dog implements Pet { +// "name of this fine beast." +// name: String! +// +// "breed of this silly animal; probably shibe." +// breed: [Breed] +// } +// +// == Example generated interface +// +// // DogResolver ... +// type DogResolver interface { +// // Name implements response to request for name field. +// Name(context.Context, interface{}, graphql.Params) interface{} +// // Breed implements response to request for breed field. +// Breed(context.Context, interface{}, graphql.Params) interface{} +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// IsTypeOf(interface{}, graphql.IsTypeOfParams) bool +// } +// +// == Example implementation ... +// +// // MyDogResolver implements DogResolver interface +// type MyDogResolver struct { +// logger logrus.LogEntry +// store interface{ +// store.BreedStore +// store.DogStore +// } +// } +// +// // Name implements response to request for name field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// return dog.GetName() +// } +// +// // Breed implements response to request for breed field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// breed := r.store.GetBreed(dog.GetBreedName()) +// return breed +// } +// +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// func (r *MyDogResolver) IsTypeOf(r interface{}, p graphql.IsTypeOfParams) interface{} { +// // ... implementation details ... +// _, ok := r.(DogGetter) +// return ok +// } +type MutationResolver interface { + // createCheck implements response to request for 'CreateCheck' field. + CreateCheck(context.Context, interface{}, graphql.Params) interface{} + // IsTypeOf is used to determine if a given value is associated with the Mutation type + IsTypeOf(context.Context, graphql.IsTypeOfParams) interface{} +} + +// Mutation The root query for implementing GraphQL mutations. +func Mutation() graphql.ObjectConfig { + return graphql.ObjectConfig{ + Description: "The root query for implementing GraphQL mutations.", + Fields: graphql.Fields{"createCheck": &graphql.Field{ + Args: graphql.FieldConfigArgument{"input": &graphql.ArgumentConfig{ + Description: "self descriptive", + Type: graphql.NewNonNull(util.InputType("CreateCheckInput")), + }}, + DeprecationReason: "", + Description: "Creates a new check.", + Name: "createCheck", + Type: util.OutputType("CreateCheckPayload"), + }}, + Interfaces: []*graphql.Interface{}, + IsTypeOf: func(_ graphql.IsTypeOfParams) bool { + // NOTE: + // Panic by default. Intent is that when Service is invoked, values of + // these fields are updated with instantiated resolvers. If these + // defaults are called it is most certainly programmer err. + // If you're see this comment then: 'Whoops! Sorry, my bad.' + panic("Unimplemented; see MutationResolver.") + }, + Name: "Mutation", + } +} + +// CreateCheckInput self descriptive +func CreateCheckInput() graphql.InputObjectConfig { + return graphql.InputObjectConfig{ + Description: "self descriptive", + Fields: graphql.InputObjectConfigFieldMap{ + "clientMutationId": &graphql.InputObjectFieldConfig{ + Description: "A unique identifier for the client performing the mutation.", + Type: graphql.String, + }, + "command": &graphql.InputObjectFieldConfig{ + Description: "self descriptive", + Type: graphql.NewNonNull(graphql.String), + }, + "name": &graphql.InputObjectFieldConfig{ + Description: "self descriptive", + Type: graphql.NewNonNull(graphql.String), + }, + "ns": &graphql.InputObjectFieldConfig{ + DefaultValue: map[string]interface{}{ + "environment": "default", + "organization": "default", + }, + Description: "namespace the resulting resource will belong to", + Type: util.InputType("Namespace"), + }, + }, + Name: "CreateCheckInput", + } +} + +// +// CreateCheckPayloadResolver represents a collection of methods whose products represent the +// response values of the 'CreateCheckPayload' type. +// +// == Example SDL +// +// """ +// Dog's are not hooman. +// """ +// type Dog implements Pet { +// "name of this fine beast." +// name: String! +// +// "breed of this silly animal; probably shibe." +// breed: [Breed] +// } +// +// == Example generated interface +// +// // DogResolver ... +// type DogResolver interface { +// // Name implements response to request for name field. +// Name(context.Context, interface{}, graphql.Params) interface{} +// // Breed implements response to request for breed field. +// Breed(context.Context, interface{}, graphql.Params) interface{} +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// IsTypeOf(interface{}, graphql.IsTypeOfParams) bool +// } +// +// == Example implementation ... +// +// // MyDogResolver implements DogResolver interface +// type MyDogResolver struct { +// logger logrus.LogEntry +// store interface{ +// store.BreedStore +// store.DogStore +// } +// } +// +// // Name implements response to request for name field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// return dog.GetName() +// } +// +// // Breed implements response to request for breed field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// breed := r.store.GetBreed(dog.GetBreedName()) +// return breed +// } +// +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// func (r *MyDogResolver) IsTypeOf(r interface{}, p graphql.IsTypeOfParams) interface{} { +// // ... implementation details ... +// _, ok := r.(DogGetter) +// return ok +// } +type CreateCheckPayloadResolver interface { + // clientMutationId implements response to request for 'ClientMutationId' field. + ClientMutationId(context.Context, interface{}, graphql.Params) interface{} + // check implements response to request for 'Check' field. + Check(context.Context, interface{}, graphql.Params) interface{} + // IsTypeOf is used to determine if a given value is associated with the CreateCheckPayload type + IsTypeOf(context.Context, graphql.IsTypeOfParams) interface{} +} + +// CreateCheckPayload self descriptive +func CreateCheckPayload() graphql.ObjectConfig { + return graphql.ObjectConfig{ + Description: "self descriptive", + Fields: graphql.Fields{ + "check": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "The new check.", + Name: "check", + Type: graphql.NewNonNull(util.OutputType("Check")), + }, + "clientMutationId": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "A unique identifier for the client performing the mutation.", + Name: "clientMutationId", + Type: graphql.String, + }, + }, + Interfaces: []*graphql.Interface{}, + IsTypeOf: func(_ graphql.IsTypeOfParams) bool { + // NOTE: + // Panic by default. Intent is that when Service is invoked, values of + // these fields are updated with instantiated resolvers. If these + // defaults are called it is most certainly programmer err. + // If you're see this comment then: 'Whoops! Sorry, my bad.' + panic("Unimplemented; see CreateCheckPayloadResolver.") + }, + Name: "CreateCheckPayload", + } +} diff --git a/backend/apid/graphql/schema/mutations.graphql b/backend/apid/graphql/schema/mutations.graphql new file mode 100644 index 0000000000..4336bfd6de --- /dev/null +++ b/backend/apid/graphql/schema/mutations.graphql @@ -0,0 +1,30 @@ +""" +The root query for implementing GraphQL mutations. +""" +type Mutation { + "Creates a new check." + createCheck(input: CreateCheckInput!): CreateCheckPayload +} + +# +# CreateCheckMutation +# + +input CreateCheckInput { + "A unique identifier for the client performing the mutation." + clientMutationId: String + + "namespace the resulting resource will belong to" + ns: Namespace = {organization: "default", environment: "default"} + + name: String! + command: String! +} + +type CreateCheckPayload { + "A unique identifier for the client performing the mutation." + clientMutationId: String + + "The new check." + check: Check! +} diff --git a/backend/apid/graphql/schema/objects.gql.go b/backend/apid/graphql/schema/objects.gql.go new file mode 100644 index 0000000000..df1dba9640 --- /dev/null +++ b/backend/apid/graphql/schema/objects.gql.go @@ -0,0 +1,370 @@ +// Code generated by graphql/generator package. DO NOT EDIT. + +package schema + +import ( + context "context" + graphql "github.com/graphql-go/graphql" + util "github.com/sensu/sensu-go/backend/apid/graphql/generator/util" +) + +// +// QueryResolver represents a collection of methods whose products represent the +// response values of the 'Query' type. +// +// == Example SDL +// +// """ +// Dog's are not hooman. +// """ +// type Dog implements Pet { +// "name of this fine beast." +// name: String! +// +// "breed of this silly animal; probably shibe." +// breed: [Breed] +// } +// +// == Example generated interface +// +// // DogResolver ... +// type DogResolver interface { +// // Name implements response to request for name field. +// Name(context.Context, interface{}, graphql.Params) interface{} +// // Breed implements response to request for breed field. +// Breed(context.Context, interface{}, graphql.Params) interface{} +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// IsTypeOf(interface{}, graphql.IsTypeOfParams) bool +// } +// +// == Example implementation ... +// +// // MyDogResolver implements DogResolver interface +// type MyDogResolver struct { +// logger logrus.LogEntry +// store interface{ +// store.BreedStore +// store.DogStore +// } +// } +// +// // Name implements response to request for name field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// return dog.GetName() +// } +// +// // Breed implements response to request for breed field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// breed := r.store.GetBreed(dog.GetBreedName()) +// return breed +// } +// +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// func (r *MyDogResolver) IsTypeOf(r interface{}, p graphql.IsTypeOfParams) interface{} { +// // ... implementation details ... +// _, ok := r.(DogGetter) +// return ok +// } +type QueryResolver interface { + // checks implements response to request for 'Checks' field. + Checks(context.Context, interface{}, graphql.Params) interface{} + // IsTypeOf is used to determine if a given value is associated with the Query type + IsTypeOf(context.Context, graphql.IsTypeOfParams) interface{} +} + +// Query The query root of Sensu's GraphQL interface. +func Query() graphql.ObjectConfig { + return graphql.ObjectConfig{ + Description: "The query root of Sensu's GraphQL interface.", + Fields: graphql.Fields{"checks": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "self descriptive", + Name: "checks", + Type: graphql.NewList(util.OutputType("Check")), + }}, + Interfaces: []*graphql.Interface{}, + IsTypeOf: func(_ graphql.IsTypeOfParams) bool { + // NOTE: + // Panic by default. Intent is that when Service is invoked, values of + // these fields are updated with instantiated resolvers. If these + // defaults are called it is most certainly programmer err. + // If you're see this comment then: 'Whoops! Sorry, my bad.' + panic("Unimplemented; see QueryResolver.") + }, + Name: "Query", + } +} + +// +// NamespaceResolver represents a collection of methods whose products represent the +// response values of the 'Namespace' type. +// +// == Example SDL +// +// """ +// Dog's are not hooman. +// """ +// type Dog implements Pet { +// "name of this fine beast." +// name: String! +// +// "breed of this silly animal; probably shibe." +// breed: [Breed] +// } +// +// == Example generated interface +// +// // DogResolver ... +// type DogResolver interface { +// // Name implements response to request for name field. +// Name(context.Context, interface{}, graphql.Params) interface{} +// // Breed implements response to request for breed field. +// Breed(context.Context, interface{}, graphql.Params) interface{} +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// IsTypeOf(interface{}, graphql.IsTypeOfParams) bool +// } +// +// == Example implementation ... +// +// // MyDogResolver implements DogResolver interface +// type MyDogResolver struct { +// logger logrus.LogEntry +// store interface{ +// store.BreedStore +// store.DogStore +// } +// } +// +// // Name implements response to request for name field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// return dog.GetName() +// } +// +// // Breed implements response to request for breed field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// breed := r.store.GetBreed(dog.GetBreedName()) +// return breed +// } +// +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// func (r *MyDogResolver) IsTypeOf(r interface{}, p graphql.IsTypeOfParams) interface{} { +// // ... implementation details ... +// _, ok := r.(DogGetter) +// return ok +// } +type NamespaceResolver interface { + // environment implements response to request for 'Environment' field. + Environment(context.Context, interface{}, graphql.Params) interface{} + // organization implements response to request for 'Organization' field. + Organization(context.Context, interface{}, graphql.Params) interface{} + // IsTypeOf is used to determine if a given value is associated with the Namespace type + IsTypeOf(context.Context, graphql.IsTypeOfParams) interface{} +} + +// Namespace represents the unique details describing where a resource is located. +func Namespace() graphql.ObjectConfig { + return graphql.ObjectConfig{ + Description: "Namespace represents the unique details describing where a resource is located.", + Fields: graphql.Fields{ + "environment": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "environment indicates to which env a check belongs to.", + Name: "environment", + Type: graphql.String, + }, + "organization": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "organization indicates to which org a check belongs to.", + Name: "organization", + Type: graphql.NewNonNull(graphql.String), + }, + }, + Interfaces: []*graphql.Interface{}, + IsTypeOf: func(_ graphql.IsTypeOfParams) bool { + // NOTE: + // Panic by default. Intent is that when Service is invoked, values of + // these fields are updated with instantiated resolvers. If these + // defaults are called it is most certainly programmer err. + // If you're see this comment then: 'Whoops! Sorry, my bad.' + panic("Unimplemented; see NamespaceResolver.") + }, + Name: "Namespace", + } +} + +// +// CheckResolver represents a collection of methods whose products represent the +// response values of the 'Check' type. +// +// == Example SDL +// +// """ +// Dog's are not hooman. +// """ +// type Dog implements Pet { +// "name of this fine beast." +// name: String! +// +// "breed of this silly animal; probably shibe." +// breed: [Breed] +// } +// +// == Example generated interface +// +// // DogResolver ... +// type DogResolver interface { +// // Name implements response to request for name field. +// Name(context.Context, interface{}, graphql.Params) interface{} +// // Breed implements response to request for breed field. +// Breed(context.Context, interface{}, graphql.Params) interface{} +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// IsTypeOf(interface{}, graphql.IsTypeOfParams) bool +// } +// +// == Example implementation ... +// +// // MyDogResolver implements DogResolver interface +// type MyDogResolver struct { +// logger logrus.LogEntry +// store interface{ +// store.BreedStore +// store.DogStore +// } +// } +// +// // Name implements response to request for name field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// return dog.GetName() +// } +// +// // Breed implements response to request for breed field. +// func (r *MyDogResolver) Name(ctx context.Context, r interface{}, p graphql.Params) interface{} { +// // ... implementation details ... +// dog := r.(DogGetter) +// breed := r.store.GetBreed(dog.GetBreedName()) +// return breed +// } +// +// // IsTypeOf is used to determine if a given value is associated with the Dog type +// func (r *MyDogResolver) IsTypeOf(r interface{}, p graphql.IsTypeOfParams) interface{} { +// // ... implementation details ... +// _, ok := r.(DogGetter) +// return ok +// } +type CheckResolver interface { + // id implements response to request for 'Id' field. + Id(context.Context, interface{}, graphql.Params) interface{} + // namespace implements response to request for 'Namespace' field. + Namespace(context.Context, interface{}, graphql.Params) interface{} + // name implements response to request for 'Name' field. + Name(context.Context, interface{}, graphql.Params) interface{} + // command implements response to request for 'Command' field. + Command(context.Context, interface{}, graphql.Params) interface{} + // handlers implements response to request for 'Handlers' field. + Handlers(context.Context, interface{}, graphql.Params) interface{} + // highFlapThreshold implements response to request for 'HighFlapThreshold' field. + HighFlapThreshold(context.Context, interface{}, graphql.Params) interface{} + // interval implements response to request for 'Interval' field. + Interval(context.Context, interface{}, graphql.Params) interface{} + // lowFlapThreshold implements response to request for 'LowFlapThreshold' field. + LowFlapThreshold(context.Context, interface{}, graphql.Params) interface{} + // publish implements response to request for 'Publish' field. + Publish(context.Context, interface{}, graphql.Params) interface{} + // IsTypeOf is used to determine if a given value is associated with the Check type + IsTypeOf(context.Context, graphql.IsTypeOfParams) interface{} +} + +// Check A Check is the specification of a check. +func Check() graphql.ObjectConfig { + return graphql.ObjectConfig{ + Description: "A Check is the specification of a check.", + Fields: graphql.Fields{ + "command": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "command is the command to be executed.", + Name: "command", + Type: graphql.NewNonNull(graphql.String), + }, + "handlers": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "handlers are the event handler for the check (incidents and/or metrics).", + Name: "handlers", + Type: graphql.NewNonNull(graphql.NewList(graphql.String)), + }, + "highFlapThreshold": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "HighFlapThreshold is the flap detection high threshold (% state change) for\nthe check. Sensu uses the same flap detection algorithm as Nagios.", + Name: "highFlapThreshold", + Type: graphql.Int, + }, + "id": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "self descriptive", + Name: "id", + Type: graphql.NewNonNull(util.OutputType("ID")), + }, + "interval": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "Interval is the interval, in seconds, at which the check should be run.", + Name: "interval", + Type: graphql.NewNonNull(graphql.Int), + }, + "lowFlapThreshold": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "LowFlapThreshold is the flap detection low threshold (% state change) for\nthe check. Sensu uses the same flap detection algorithm as Nagios.", + Name: "lowFlapThreshold", + Type: graphql.Int, + }, + "name": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "name is the unique identifier for a check", + Name: "name", + Type: graphql.NewNonNull(graphql.String), + }, + "namespace": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "self descriptive", + Name: "namespace", + Type: graphql.NewNonNull(util.OutputType("Namespace")), + }, + "publish": &graphql.Field{ + Args: graphql.FieldConfigArgument{}, + DeprecationReason: "", + Description: "Publish indicates if check requests are published for the check", + Name: "publish", + Type: graphql.NewNonNull(graphql.Boolean), + }, + }, + Interfaces: []*graphql.Interface{}, + IsTypeOf: func(_ graphql.IsTypeOfParams) bool { + // NOTE: + // Panic by default. Intent is that when Service is invoked, values of + // these fields are updated with instantiated resolvers. If these + // defaults are called it is most certainly programmer err. + // If you're see this comment then: 'Whoops! Sorry, my bad.' + panic("Unimplemented; see CheckResolver.") + }, + Name: "Check", + } +} diff --git a/backend/apid/graphql/schema/objects.graphql b/backend/apid/graphql/schema/objects.graphql new file mode 100644 index 0000000000..943634875e --- /dev/null +++ b/backend/apid/graphql/schema/objects.graphql @@ -0,0 +1,54 @@ +""" +The query root of Sensu's GraphQL interface. +""" +type Query { + # TODO: Remove me. + checks: [Check] +} + +""" +Namespace represents the unique details describing where a resource is located. +""" +type Namespace { + "environment indicates to which env a check belongs to." + environment: String + + "organization indicates to which org a check belongs to." + organization: String! +} + + +""" +A Check is the specification of a check. +""" +type Check { + id: ID! + namespace: Namespace! + + "name is the unique identifier for a check" + name: String! + + "command is the command to be executed." + command: String! + + "handlers are the event handler for the check (incidents and/or metrics)." + handlers: [String]! + + """ + HighFlapThreshold is the flap detection high threshold (% state change) for + the check. Sensu uses the same flap detection algorithm as Nagios. + """ + highFlapThreshold: Int + + "Interval is the interval, in seconds, at which the check should be run." + interval: Int! + + """ + LowFlapThreshold is the flap detection low threshold (% state change) for + the check. Sensu uses the same flap detection algorithm as Nagios. + """ + lowFlapThreshold: Int + + "Publish indicates if check requests are published for the check" + publish: Boolean! +} diff --git a/backend/apid/graphql/schema/schema.gql.go b/backend/apid/graphql/schema/schema.gql.go new file mode 100644 index 0000000000..22e3509f0c --- /dev/null +++ b/backend/apid/graphql/schema/schema.gql.go @@ -0,0 +1,16 @@ +// Code generated by graphql/generator package. DO NOT EDIT. + +package schema + +import ( + graphql "github.com/graphql-go/graphql" + util "github.com/sensu/sensu-go/backend/apid/graphql/generator/util" +) + +// Schema exposes the root types for each operation. +func Schema() graphql.SchemaConfig { + return graphql.SchemaConfig{ + Mutation: util.Object("Mutation"), + Query: util.Object("Query"), + } +} diff --git a/backend/apid/graphql/schema/schema.graphql b/backend/apid/graphql/schema/schema.graphql new file mode 100644 index 0000000000..c3c82a744c --- /dev/null +++ b/backend/apid/graphql/schema/schema.graphql @@ -0,0 +1,4 @@ +schema { + query: Query + mutation: Mutation +}