aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/schema.go
blob: f8fb976852bd2fdd1719ae7f0255adf83ccbaa0b (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 graphqlSchema() (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)
}