aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/schema.go
blob: e929fb44f74597aa8ace09d4dc867ef7ddd09428 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package graphql

import "github.com/graphql-go/graphql"

func newGraphqlSchema() (graphql.Schema, error) {

	rootQuery := graphql.ObjectConfig{
		Name: "RootQuery",
		Fields: graphql.Fields{
			"hello": &graphql.Field{
				Type: graphql.String,
			},
		},
	}

	schemaConfig := graphql.SchemaConfig{
		Query: graphql.NewObject(rootQuery),
	}

	return graphql.NewSchema(schemaConfig)
}