aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/schema.go
diff options
context:
space:
mode:
Diffstat (limited to 'graphql/schema.go')
-rw-r--r--graphql/schema.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/graphql/schema.go b/graphql/schema.go
new file mode 100644
index 00000000..f6523f03
--- /dev/null
+++ b/graphql/schema.go
@@ -0,0 +1,17 @@
+package graphql
+
+import "github.com/graphql-go/graphql"
+
+func graphqlSchema() (graphql.Schema, error) {
+ fields := graphql.Fields{
+ "hello": &graphql.Field{
+ Type: graphql.String,
+ Resolve: func(p graphql.ResolveParams) (interface{}, error) {
+ return "world", nil
+ },
+ },
+ }
+ rootQuery := graphql.ObjectConfig{Name: "RootQuery", Fields: fields}
+ schemaConfig := graphql.SchemaConfig{Query: graphql.NewObject(rootQuery)}
+ return graphql.NewSchema(schemaConfig)
+}